Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
tool_oauth2\form\issuer Class Reference

Issuer form. More...

Inheritance diagram for tool_oauth2\form\issuer:

Public Member Functions

 __construct ($action=null, $customdata=null, $method='post', $target='', $attributes=null, $editable=true, array $ajaxformdata=null)
 Constructor.
 
 definition ()
 Define the form - called by parent constructor.
 
 definition_after_data ()
 This method implements changes to the form that need to be made once the form data is set.
 

Protected Member Functions

 extra_validation ($data, $files, array &$errors)
 Define extra validation mechanims.
 

Protected Attributes

string $type
 $type
 

Static Protected Attributes

static array $fieldstoremove = array('type', 'submitbutton', 'action')
 $fieldstoremove
 
static string $persistentclass = 'core\\oauth2\\issuer'
 $persistentclass
 

Detailed Description

Issuer form.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

tool_oauth2\form\issuer::__construct ( $action = null,
$customdata = null,
$method = 'post',
$target = '',
$attributes = null,
$editable = true,
array $ajaxformdata = null )

Constructor.

The 'persistent' has to be passed as custom data when 'editing'. If a standard issuer is created the type can be passed as custom data, which alters the form according to the type.

Note that in order for your persistent to be reloaded after form submission you should either override the URL to include the ID to your resource, or add the ID to the form fields.

Parameters
mixed$action
mixed$customdata
string$method
string$target
mixed$attributes
bool$editable
array$ajaxformdata

Member Function Documentation

◆ extra_validation()

tool_oauth2\form\issuer::extra_validation ( $data,
$files,
array & $errors )
protected

Define extra validation mechanims.

The data here:

  • does not include {
    See also
    self\$fieldstoremove}.
  • does include {
    See also
    self\$foreignfields}.
  • was converted to map persistent-like data, e.g. array $description to string $description + int $descriptionformat.

You can modify the $errors parameter in order to remove some validation errors should you need to. However, the best practice is to return new or overriden errors. Only modify the errors passed by reference when you have no other option.

Do not add any logic here, it is only intended to be used by child classes.

Parameters
stdClass$dataData to validate.
array$filesArray of files.
array$errorsCurrently reported errors.
Return values
arrayof additional errors, or overridden errors.

The documentation for this class was generated from the following file: