original_string: public static function purpose_options($purposes, $includenotset = true, $includeinherit = true) {
          $options = self::base_options($includenotset, $includeinherit);
          foreach ($purposes as $purpose) {
              $options[$purpose->get('id')] = $purpose->get('name');
          }
  
          return $options;
      }
code: public static function purpose_options($purposes, $includenotset = true, $includeinherit = true) {
          $options = self::base_options($includenotset, $includeinherit);
          foreach ($purposes as $purpose) {
              $options[$purpose->get('id')] = $purpose->get('name');
          }
  
          return $options;
      }
code_tokens: public static function purpose_options ( $ purposes , $ includenotset = true , $ includeinherit = true ) { $ options = self :: base_options ( $ includenotset , $ includeinherit ) ; foreach ( $ purposes as $ purpose ) { $ options [ $ purpose -> get ( 'id' ) ] = $ purpose -> get ( 'name' ) ; } return $ options ; }
docstring: From a list of purpose persistents to a list of id => name purposes.
  
  @param \tool_dataprivacy\purpose[] $purposes
  @param bool $includenotset
  @param bool $includeinherit
  @return string[]
docstring_tokens: From a list of purpose persistents to a list of id = > name purposes .