Gets the schema state used to render the FormField on the front-end.

@return array
194821
public function getSchemaState()
    {
        $defaults = $this->getSchemaStateDefaults();
        return array_merge($defaults, array_intersect_key($this->schemaState, $defaults));
    }
956042
public function getDataSchema()
    {
        $schema = [
            'description' => $this->Description,
            'link' => 'https://addons.silverstripe.org/add-ons/' . $this->Name,
            'linkTitle' => _t(
                __CLASS__ . '.ADDONS_LINK_TITLE',
                'View {package} on addons.silverstripe.org',
                ['package' => $this->Title]
            ),
            'rating'=> (int) $this->Rating
        ];

        $this->extend('updateDataSchema', $schema);

        return $schema;
    }
56672
public function get_form_fields() {
        if (empty($this->type)) {
            return '';
        }

        $result  = '<input type="hidden" name="gpr_type" value="'.$this->type.'" />';

        if (!empty($this->plugin)) {
            $result .= '<input type="hidden" name="gpr_plugin" value="'.$this->plugin.'" />';
        }

        if (!empty($this->courseid)) {
            $result .= '<input type="hidden" name="gpr_courseid" value="'.$this->courseid.'" />';
        }

        if (!empty($this->userid)) {
            $result .= '<input type="hidden" name="gpr_userid" value="'.$this->userid.'" />';
        }

        if (!empty($this->groupid)) {
            $result .= '<input type="hidden" name="gpr_groupid" value="'.$this->groupid.'" />';
        }

        if (!empty($this->page)) {
            $result .= '<input type="hidden" name="gpr_page" value="'.$this->page.'" />';
        }
        return $result;
    }
1275886
public function getSchemaDataDefaults()
    {
        return [
            'name' => $this->getName(),
            'id' => $this->ID(),
            'type' => $this->getInputType(),
            'schemaType' => $this->getSchemaDataType(),
            'component' => $this->getSchemaComponent(),
            'holderId' => $this->HolderID(),
            'title' => $this->obj('Title')->getSchemaValue(),
            'source' => null,
            'extraClass' => $this->extraClass(),
            'description' => $this->obj('Description')->getSchemaValue(),
            'rightTitle' => $this->obj('RightTitle')->getSchemaValue(),
            'leftTitle' => $this->obj('LeftTitle')->getSchemaValue(),
            'readOnly' => $this->isReadonly(),
            'disabled' => $this->isDisabled(),
            'customValidationMessage' => $this->getCustomValidationMessage(),
            'validation' => $this->getSchemaValidation(),
            'attributes' => [],
            'autoFocus' => $this->isAutofocus(),
            'data' => [],
        ];
    }
823694
public function getSchema()
    {
        $schemaLocation = $this->documentElement->getAttribute('xsi:schemaLocation');
        if (!$schemaLocation or strpos($schemaLocation, ' ')===false)
            return false;
        list($uri, $xsd) = explode(' ', $schemaLocation);
        return $xsd;
    }
566089
public static function getAllSchemas()
    {
        // registry schema
        $registrySchemaFilename = dirname(__FILE__).'/Validators/schemas/registry.json';
        $registry = [
            (object) [
                'id' => 'registry',
                'schema' => 'https://specs.frictionlessdata.io/schemas/registry.json',
                'schema_path' => 'registry.json',
            ],
        ];
        // schemas from the registry (currently contains only the datapackage scheams)
        $schemaIds = [];
        if (file_exists($registrySchemaFilename)) {
            foreach (json_decode(file_get_contents($registrySchemaFilename)) as $schema) {
                $schemaIds[] = $schema->id;
                $registry[] = $schema;
            }
            // resource schemas - currently not in the registry
            foreach (['data-resource', 'tabular-data-resource'] as $id) {
                if (!in_array($id, $schemaIds)) {
                    $registry[] = (object) [
                        'id' => $id,
                        'schema' => "https://specs.frictionlessdata.io/schemas/{$id}.json",
                        'schema_path' => "{$id}.json",
                    ];
                }
            }
        }
        // custom registered schemas
        foreach (static::$registeredSchemas as $profile => $schema) {
            $registry[] = (object) [
                'id' => $profile,
                'schema_filename' => $schema['filename'],
            ];
        }

        return $registry;
    }
1269889
public function getJsonItemSchemas()
	{
		$list = array();

		foreach( $this->_getControllers() as $name => $controller ) {
			$list[$name] = $controller->getItemSchema();
		}

		if( ( $json = json_encode( $list ) ) === null ) {
			throw new Exception( 'Unable to encode schemas to JSON' );
		}

		return $json;
	}
1000226
public function getSchema(): Schema
    {
        if ($this->schema === null) {
            $this->schema = new Schema($this);
        }

        return $this->schema;
    }
805440
public function getFields()
    {
        $hierarchy = [];
        foreach ($this->def->getTarget()->getFields() as $field) {
            $hierarchy = array_merge_recursive(
                $hierarchy,
                $this->createFieldHierarchyRecursive($field, $field->getName())
            );
        }

        $fields = [];

        /*******
         * CONDITIONAL GENERATED FIELD AREA
         *
         * so simplify things, you can put fields here that should be conditionally created by Graviton.
         * @TODO refactor into a FieldBuilder* type of thing where different builders can add fields conditionally.
         */

        // Versioning field, for version control.
        if ($this->def->getService() && $this->def->getService()->getVersioning()) {
            $definition = new Schema\Field();
            $constraint = new Constraint();
            $constraint->setName('versioning');
            $definition->setName(VersionServiceConstraint::FIELD_NAME)->setTitle('Version')->setType('int')
                       ->setConstraints([$constraint])
                       ->setDescription('Document version. You need to send current version if you want to update.');
            $fields['version'] = $this->processSimpleField('version',  $definition);
        }

        /*******
         * add fields as defined in the definition file.
         */

        foreach ($hierarchy as $name => $definition) {
            $fields[$name] = $this->processFieldHierarchyRecursive($name, $definition);
        }

        return $fields;
    }
604539
private function buildStates(): array
    {
        $states = [];
        foreach ($this->getOffsetFromArray($this->schema, 'states', []) as $state) {
            $states[] = new State(
                $this->getOffsetFromArray($state, 'name'),
                $this->buildEvents($state),
                $this->getAdditionalFromArray($state, ['events', 'name'])
            );
        }

        return $states;
    }
15171
public static function get_all() {
        $states = array();
        $us = new ReflectionClass('question_state');
        foreach ($us->getStaticProperties() as $name => $notused) {
            $states[] = self::$$name;
        }
        return $states;
    }
25067
protected function getSchemaForEntity(): Schema
    {
        if ($this->entityClass instanceof Schema) {
            return $this->entityClass;
        }

        $model = new $this->entityClass();

        if ($model instanceof ActiveRecord) {
            return $model->getSchema();
        }

        return new DynamicSchema();
    }
1356609
public function getAttributes()
    {
        $attributes = parent::getAttributes();

        $attributes['data-schema'] = json_encode($this->getSchemaData());
        $attributes['data-state'] = json_encode($this->getSchemaState());

        return $attributes;
    }
1282512
public function getState()
    {
        return [
            'items' => $this->items,
            'rules' => $this->rules,
            'nested' => $this->nested,
            'dynamic' => $this->dynamic,
            'filter' => $this->filter
        ];
    }
405236
protected function getSchema()
    {
        if ($this->schema) {
            return $this->schema;
        }

        $hasDoctrine = interface_exists('Doctrine\DBAL\Driver');
        if (!$hasDoctrine) {
            return [];
        }

        /** @var \Doctrine\DBAL\Platforms\AbstractPlatform $platform */
        $platform = $this->connection->getDoctrineConnection()->getDatabasePlatform();
        $platform->registerDoctrineTypeMapping('json', 'string');

        /* @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */
        $this->schema = $this->connection->getDoctrineSchemaManager();

        return $this->schema;
    }
1084985
public function get_field_schema() {
		$fields = $this->get_registered_fields();

		$schema = array(
			'description' => __( 'Meta fields.' ),
			'type'        => 'object',
			'context'     => array( 'view', 'edit' ),
			'properties'  => array(),
		);

		foreach ( $fields as $key => $args ) {
			$schema['properties'][ $key ] = $args['schema'];
		}

		return $schema;
	}
1359570
function GetSchema() {
		$this->LoadSchema();
		$schema = array(
			'_model' => $this->model,
			'_table' => $this->table,
		);
		$schema = array_merge($schema, $this->schema);
		$schema['_id'] = $this->schema['_id']['field'];
		$this->Trigger('getschema', $schema);
		return $schema;
	}