Return the definition of the properties of this model.

@return  array
356510
protected static function define_properties() {
        return array(
            'purposeid' => array(
                'type' => PARAM_INT,
                'description' => 'The purpose that that this override relates to',
            ),
            'roleid' => array(
                'type' => PARAM_INT,
                'description' => 'The role that that this override relates to',
            ),
            'lawfulbases' => array(
                'type' => PARAM_TEXT,
                'description' => 'Comma-separated IDs matching records in tool_dataprivacy_lawfulbasis.',
                'null' => NULL_ALLOWED,
                'default' => null,
            ),
            'sensitivedatareasons' => array(
                'type' => PARAM_TEXT,
                'description' => 'Comma-separated IDs matching records in tool_dataprivacy_sensitive',
                'null' => NULL_ALLOWED,
                'default' => null,
            ),
            'retentionperiod' => array(
                'type' => PARAM_ALPHANUM,
                'description' => 'Retention period. ISO_8601 durations format (as in DateInterval format).',
                'default' => '',
            ),
            'protected' => array(
                'type' => PARAM_INT,
                'description' => 'Data retention with higher precedent over user\'s request to be forgotten.',
                'default' => '0',
            ),
        );
    }
327692
public function getDefinitions()
    {
        if (false !== $this->definitions) {
            return $this->definitions;
        }

        $config = $this->metadataLoader->load($this->resource, $this->resourceType);

        if (null === $config) {
            return [];
        }

        return $this->definitions = $config;
    }
695040
protected function propertiesFromAttributes(): array
    {
        // Get all managed properties
        $propertyNames = $this->entityMap->getProperties();

        $propertyAttributes = array_only($this->attributes, $propertyNames);
        $attributesArray = array_except($this->attributes, $propertyNames);

        $attributesArrayName = $this->entityMap->getAttributesArrayName();

        if ($attributesArrayName) {
            $propertyAttributes[$attributesArrayName] = $attributesArray;
        }

        return $propertyAttributes;
    }
734523
public function properties()
    {
        if ($this->properties === null || $this->parsedProperties === false) {
            $this->parsedProperties = true;

            $model = $this->proto();
            $properties = $model->metadata()->properties();

            $listProperties = null;
            if ($this->properties === null) {
                $collectionConfig = $this->collectionConfig();
                if (isset($collectionConfig['properties'])) {
                    $listProperties = array_flip($collectionConfig['properties']);
                }
            } else {
                $listProperties = array_flip($this->properties);
            }

            if ($listProperties) {
                // Replacing values of listProperties from index to actual property values
                $properties = array_replace($listProperties, $properties);
                // Get only the keys that are in listProperties from props
                $properties = array_intersect_key($properties, $listProperties);
            }

            $this->properties = $properties;
        }

        return $this->properties;
    }
263590
protected function getGeneratedProperties(): array
    {
        $reflectionObject = new \ReflectionObject($this);
        $properties = $reflectionObject->getProperties(\ReflectionProperty::IS_PUBLIC);
        $result = [];
        foreach ($properties as $property) {
            if (!$property->isPublic() || @$property->isDefault()) {
                continue;
            }

            $result[] = $property;
        }

        return $result;
    }
609408
protected static function define_properties() {
        return [
            'type' => [
                'choices' => [
                    api::DATAREQUEST_TYPE_EXPORT,
                    api::DATAREQUEST_TYPE_DELETE,
                    api::DATAREQUEST_TYPE_OTHERS,
                ],
                'type' => PARAM_INT
            ],
            'comments' => [
                'type' => PARAM_TEXT,
                'default' => ''
            ],
            'commentsformat' => [
                'choices' => [
                    FORMAT_HTML,
                    FORMAT_MOODLE,
                    FORMAT_PLAIN,
                    FORMAT_MARKDOWN
                ],
                'type' => PARAM_INT,
                'default' => FORMAT_PLAIN
            ],
            'userid' => [
                'default' => 0,
                'type' => PARAM_INT
            ],
            'requestedby' => [
                'default' => 0,
                'type' => PARAM_INT
            ],
            'status' => [
                'default' => api::DATAREQUEST_STATUS_AWAITING_APPROVAL,
                'choices' => [
                    api::DATAREQUEST_STATUS_PENDING,
                    api::DATAREQUEST_STATUS_AWAITING_APPROVAL,
                    api::DATAREQUEST_STATUS_APPROVED,
                    api::DATAREQUEST_STATUS_PROCESSING,
                    api::DATAREQUEST_STATUS_COMPLETE,
                    api::DATAREQUEST_STATUS_CANCELLED,
                    api::DATAREQUEST_STATUS_REJECTED,
                    api::DATAREQUEST_STATUS_DOWNLOAD_READY,
                    api::DATAREQUEST_STATUS_EXPIRED,
                    api::DATAREQUEST_STATUS_DELETED,
                ],
                'type' => PARAM_INT
            ],
            'dpo' => [
                'default' => 0,
                'type' => PARAM_INT,
                'null' => NULL_ALLOWED
            ],
            'dpocomment' => [
                'default' => '',
                'type' => PARAM_TEXT,
                'null' => NULL_ALLOWED
            ],
            'dpocommentformat' => [
                'choices' => [
                    FORMAT_HTML,
                    FORMAT_MOODLE,
                    FORMAT_PLAIN,
                    FORMAT_MARKDOWN
                ],
                'type' => PARAM_INT,
                'default' => FORMAT_PLAIN
            ],
            'creationmethod' => [
                'default' => self::DATAREQUEST_CREATION_MANUAL,
                'choices' => [
                    self::DATAREQUEST_CREATION_MANUAL,
                    self::DATAREQUEST_CREATION_AUTO
                ],
                'type' => PARAM_INT
            ],
        ];
    }
1010107
private function getMetadataProperties()
    {
        $triples = $this->getResource()->getRdfTriples();
        $properties = [];
        foreach ($triples as $triple){
            $properties[$triple->predicate] = $triple->object;
        }
        //we also include a shortcut to the item URI
        $properties['@uri'] = $this->getResource()->getUri();
        return $properties;
    }
1092947
public function getAdminProperties() {

		if( !isset( $this->adminProperties ) ) {

			$this->adminProperties = AdminProperties::getInstance();
		}

		return $this->adminProperties;
	}
381627
protected static function define_other_properties() {
        return [
            'events' => [
                'type' => event_exporter::read_properties_definition(),
                'multiple' => true,
            ],
            'firstid' => [
                'type' => PARAM_INT,
                'null' => NULL_ALLOWED,
                'default' => null,
            ],
            'lastid' => [
                'type' => PARAM_INT,
                'null' => NULL_ALLOWED,
                'default' => null,
            ],
        ];
    }
107711
public function getRequiredRelationProperties(): array
    {
        if (null !== $this->requiredRelationProperties) {
            return $this->requiredRelationProperties;
        }
        $traits = $this->reflectionClass->getTraits();
        $return = [];
        foreach ($traits as $traitName => $traitReflection) {
            if (false === \ts\stringContains($traitName, '\\HasRequired')) {
                continue;
            }
            if (false === \ts\stringContains($traitName, '\\Entity\\Relations\\')) {
                continue;
            }

            $property          = $traitReflection->getProperties()[0]->getName();
            $return[$property] = $this->getTypesFromVarComment(
                $property,
                $this->getReflectionHelper()->getTraitProvidingProperty($traitReflection, $property)
            );
        }
        $this->requiredRelationProperties = $return;

        return $return;
    }
1341008
public function properties() {
        $properties = clone($this->properties);
        if ($this->answers === null) {
            $this->get_answers();
        }
        if (count($this->answers)>0) {
            $count = 0;
            $qtype = $properties->qtype;
            foreach ($this->answers as $answer) {
                $properties->{'answer_editor['.$count.']'} = array('text' => $answer->answer, 'format' => $answer->answerformat);
                if ($qtype != LESSON_PAGE_MATCHING) {
                    $properties->{'response_editor['.$count.']'} = array('text' => $answer->response, 'format' => $answer->responseformat);
                } else {
                    $properties->{'response_editor['.$count.']'} = $answer->response;
                }
                $properties->{'jumpto['.$count.']'} = $answer->jumpto;
                $properties->{'score['.$count.']'} = $answer->score;
                $count++;
            }
        }
        return $properties;
    }
882551
protected static function define_properties() {
        return array(
            'userid' => array(
                'type' => PARAM_INT
            ),
            'name' => array(
                'type' => PARAM_TEXT
            ),
            'description' => array(
                'type' => PARAM_CLEANHTML,
                'default' => '',
            ),
            'descriptionformat' => array(
                'choices' => array(FORMAT_HTML, FORMAT_MOODLE, FORMAT_PLAIN, FORMAT_MARKDOWN),
                'type' => PARAM_INT,
                'default' => FORMAT_HTML,
            ),
            'url' => array(
                'type' => PARAM_URL,
                'default' => '',
                'message' => new lang_string('invalidurl', 'core_competency')
            )
        );
    }
433810
public function getComputedProperties()
    {
        $result = array();

        if($entity = $this->getIterator()->current()) {
            $result = $entity->getComputedProperties();
        }

        return $result;
    }
291718
protected static function define_properties() {
        return array(
            'id' => array(
                'type' => PARAM_INT,
                'null' => NULL_ALLOWED,
                'description' => 'Post/entry id.',
            ),
            'module' => array(
                'type' => PARAM_ALPHANUMEXT,
                'null' => NULL_NOT_ALLOWED,
                'description' => 'Where it was published the post (blog, blog_external...).',
            ),
            'userid' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Post author.',
            ),
            'courseid' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Course where the post was created.',
            ),
            'groupid' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Group post was created for.',
            ),
            'moduleid' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Module id where the post was created (not used anymore).',
            ),
            'coursemoduleid' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Course module id where the post was created.',
            ),
            'subject' => array(
                'type' => PARAM_TEXT,
                'null' => NULL_NOT_ALLOWED,
                'description' => 'Post subject.',
            ),
            'summary' => array(
                'type' => PARAM_RAW,
                'null' => NULL_ALLOWED,
                'description' => 'Post summary.',
            ),
            'content' => array(
                'type' => PARAM_RAW,
                'null' => NULL_ALLOWED,
                'description' => 'Post content.',
            ),
            'uniquehash' => array(
                'type' => PARAM_RAW,
                'null' => NULL_NOT_ALLOWED,
                'description' => 'Post unique hash.',
            ),
            'rating' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Post rating.',
            ),
            'format' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'Post content format.',
            ),
            'summaryformat' => array(
                'choices' => array(FORMAT_HTML, FORMAT_MOODLE, FORMAT_PLAIN, FORMAT_MARKDOWN),
                'type' => PARAM_INT,
                'default' => FORMAT_MOODLE,
                'description' => 'Format for the summary field.',
            ),
            'attachment' => array(
                'type' => PARAM_RAW,
                'null' => NULL_ALLOWED,
                'description' => 'Post atachment.',
            ),
            'publishstate' => array(
                'type' => PARAM_ALPHA,
                'null' => NULL_NOT_ALLOWED,
                'default' => 'draft',
                'description' => 'Post publish state.',
            ),
            'lastmodified' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'When it was last modified.',
            ),
            'created' => array(
                'type' => PARAM_INT,
                'null' => NULL_NOT_ALLOWED,
                'default' => 0,
                'description' => 'When it was created.',
            ),
            'usermodified' => array(
                'type' => PARAM_INT,
                'null' => NULL_ALLOWED,
                'description' => 'User that updated the post.',
            ),
        );
    }
1275051
protected static function define_other_properties() {
        return [
            'icon' => [
                'type' => event_icon_exporter::read_properties_definition(),
            ],
            'category' => [
                'type' => coursecat_summary_exporter::read_properties_definition(),
                'optional' => true,
            ],
            'course' => [
                'type' => course_summary_exporter::read_properties_definition(),
                'optional' => true,
            ],
            'subscription' => [
                'type' => event_subscription_exporter::read_properties_definition(),
                'optional' => true,
            ],
            'canedit' => [
                'type' => PARAM_BOOL
            ],
            'candelete' => [
                'type' => PARAM_BOOL
            ],
            'deleteurl' => [
                'type' => PARAM_URL
            ],
            'editurl' => [
                'type' => PARAM_URL
            ],
            'viewurl' => [
                'type' => PARAM_URL
            ],
            'formattedtime' => [
                'type' => PARAM_RAW,
            ],
            'isactionevent' => [
                'type' => PARAM_BOOL
            ],
            'iscourseevent' => [
                'type' => PARAM_BOOL
            ],
            'iscategoryevent' => [
                'type' => PARAM_BOOL
            ],
            'groupname' => [
                'type' => PARAM_RAW,
                'optional' => true,
                'default' => null,
                'null' => NULL_ALLOWED
            ],
            'normalisedeventtype' => [
                'type' => PARAM_TEXT
            ],
            'normalisedeventtypetext' => [
                'type' => PARAM_TEXT
            ],
        ];
    }
1076522
public function toArray()
    {
        $properties = $this->properties;

        foreach ($properties as $name => $value) {
            if ($value instanceof Entity) {
                $properties[$name] = $value->toArray();
            }
        }

        return $properties;
    }
1235577
public function getProperties() {
    $properties = array();
    foreach ($this->properties as $property) {
      if ($property->getDeclaringClass() instanceof GClass && 
          $property->getDeclaringClass()->equals($this)) {
        $properties[$property->getName()] = $property;
      }
    }
    return $properties;
  }