Class api.  
 More...
 | 
| static  | delete_category (category_controller $category) | 
|   | Delete a custom field category.  More...
  | 
|   | 
| static  | delete_field_configuration (field_controller $field) | 
|   | Delete a field.  More...
  | 
|   | 
| static  | get_available_field_types () | 
|   | Retrieve a list of all available custom field types.  More...
  | 
|   | 
| static  | get_categories_with_fields (string $component, string $area, int $itemid) | 
|   | Returns a list of categories with their related fields.  More...
  | 
|   | 
| static  | get_category_inplace_editable (category_controller $category, bool $editable=true) | 
|   | Returns an object for inplace editable.  More...
  | 
|   | 
| static  | get_fields_supporting_course_grouping () | 
|   | Get a list of the course custom fields that support course grouping in block_myoverview.  More...
  | 
|   | 
| static  | get_instance_fields_data (array $fields, int $instanceid, bool $adddefaults=true) | 
|   | For the given instance and list of fields fields retrieves data associated with them.  More...
  | 
|   | 
| static  | get_instances_fields_data (array $fields, array $instanceids, bool $adddefaults=true) | 
|   | For given list of instances and fields retrieves data associated with them.  More...
  | 
|   | 
| static  | move_category (category_controller $category, int $beforeid=0) | 
|   | Reorder categories, move given category before another category.  More...
  | 
|   | 
| static  | move_field (field_controller $field, int $categoryid, int $beforeid=0) | 
|   | Change fields sort order, move field to another category.  More...
  | 
|   | 
| static  | prepare_field_for_config_form (field_controller $field) | 
|   | Prepares the object to pass to field configuration form set_data() method.  More...
  | 
|   | 
| static  | save_category (category_controller $category) | 
|   | Insert or update custom field category.  More...
  | 
|   | 
| static  | save_field_configuration (field_controller $field, stdClass $formdata) | 
|   | Updates or creates a field with data that came from a form.  More...
  | 
|   | 
◆ delete_category()
Delete a custom field category. 
- Parameters
 - 
  
  
 
- Return values
 - 
  
  
 
 
 
◆ delete_field_configuration()
  
  
      
        
          | static core_customfield\api::delete_field_configuration  | 
          ( | 
          field_controller  | 
          $field | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Delete a field. 
- Parameters
 - 
  
  
 
 
 
◆ get_available_field_types()
  
  
      
        
          | static core_customfield\api::get_available_field_types  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Retrieve a list of all available custom field types. 
- Return values
 - 
  
    | array | a list of the fieldtypes suitable to use in a select statement  | 
  
   
 
 
◆ get_categories_with_fields()
  
  
      
        
          | static core_customfield\api::get_categories_with_fields  | 
          ( | 
          string  | 
          $component,  | 
         
        
           | 
           | 
          string  | 
          $area,  | 
         
        
           | 
           | 
          int  | 
          $itemid  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Returns a list of categories with their related fields. 
- Parameters
 - 
  
    | string | $component |  | 
    | string | $area |  | 
    | int | $itemid |  | 
  
   
- Return values
 - 
  
  
 
 
 
◆ get_category_inplace_editable()
  
  
      
        
          | static core_customfield\api::get_category_inplace_editable  | 
          ( | 
          category_controller  | 
          $category,  | 
         
        
           | 
           | 
          bool  | 
          $editable = true  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Returns an object for inplace editable. 
- Parameters
 - 
  
  
 
- Return values
 - 
  
  
 
 
 
◆ get_fields_supporting_course_grouping()
  
  
      
        
          | static core_customfield\api::get_fields_supporting_course_grouping  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Get a list of the course custom fields that support course grouping in block_myoverview. 
- Return values
 - 
  
    | array::$shortname | => $name  | 
  
   
 
 
◆ get_instance_fields_data()
  
  
      
        
          | static core_customfield\api::get_instance_fields_data  | 
          ( | 
          array  | 
          $fields,  | 
         
        
           | 
           | 
          int  | 
          $instanceid,  | 
         
        
           | 
           | 
          bool  | 
          $adddefaults = true  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
For the given instance and list of fields fields retrieves data associated with them. 
- Parameters
 - 
  
    | field_controller[] | $fields | list of fields indexed by field id  | 
    | int | $instanceid |  | 
    | bool | $adddefaults |  | 
  
   
- Return values
 - 
  
    | data_controller[] | array of data_controller objects indexed by fieldid. All fields are present, some data_controller objects may have 'id', some not If ($adddefaults): All fieldids are present, some data_controller objects may have 'id', some not. If (!$adddefaults): Only fieldids with data are present, all data_controller objects have 'id'.  | 
  
   
 
 
◆ get_instances_fields_data()
  
  
      
        
          | static core_customfield\api::get_instances_fields_data  | 
          ( | 
          array  | 
          $fields,  | 
         
        
           | 
           | 
          array  | 
          $instanceids,  | 
         
        
           | 
           | 
          bool  | 
          $adddefaults = true  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
For given list of instances and fields retrieves data associated with them. 
- Parameters
 - 
  
    | field_controller[] | $fields | list of fields indexed by field id  | 
    | int[] | $instanceids |  | 
    | bool | $adddefaults |  | 
  
   
- Return values
 - 
  
    | data_controller[][] | 2-dimension array, first index is instanceid, second index is fieldid. If ($adddefaults): All instanceids and all fieldids are present, some data_controller objects may have 'id', some not. If (!$adddefaults): All instanceids are present but only fieldids with data are present, all data_controller objects have 'id'.  | 
  
   
 
 
◆ move_category()
  
  
      
        
          | static core_customfield\api::move_category  | 
          ( | 
          category_controller  | 
          $category,  | 
         
        
           | 
           | 
          int  | 
          $beforeid = 0  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Reorder categories, move given category before another category. 
- Parameters
 - 
  
    | category_controller | $category | category that needs to be moved  | 
    | int | $beforeid | id of the category this category needs to be moved before, 0 to move to the end  | 
  
   
 
 
◆ move_field()
  
  
      
        
          | static core_customfield\api::move_field  | 
          ( | 
          field_controller  | 
          $field,  | 
         
        
           | 
           | 
          int  | 
          $categoryid,  | 
         
        
           | 
           | 
          int  | 
          $beforeid = 0  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Change fields sort order, move field to another category. 
- Parameters
 - 
  
    | field_controller | $field | field that needs to be moved  | 
    | int | $categoryid | category that needs to be moved  | 
    | int | $beforeid | id of the category this category needs to be moved before, 0 to move to the end  | 
  
   
 
 
◆ prepare_field_for_config_form()
  
  
      
        
          | static core_customfield\api::prepare_field_for_config_form  | 
          ( | 
          field_controller  | 
          $field | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Prepares the object to pass to field configuration form set_data() method. 
- Parameters
 - 
  
  
 
- Return values
 - 
  
  
 
 
 
◆ save_category()
Insert or update custom field category. 
- Parameters
 - 
  
  
 
 
 
◆ save_field_configuration()
  
  
      
        
          | static core_customfield\api::save_field_configuration  | 
          ( | 
          field_controller  | 
          $field,  | 
         
        
           | 
           | 
          stdClass  | 
          $formdata  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
static   | 
  
 
Updates or creates a field with data that came from a form. 
- Parameters
 - 
  
  
 
 
 
The documentation for this class was generated from the following file: