Return php-schema definition that reflects the structural expectations towards state (yaml)data.

@return mixed[]
4278
private function getStateSchema(): array
    {
        return [
            "type" => "assoc" ,
            "required" => false,
            "properties" => [
                "class" => [ "type" => "fqcn", "required" => false ],
                "initial" => [
                    "type" => "bool",
                    "required" => false
                ],
                "final" => [
                    "type" => "bool",
                    "required" => false
                ],
                "interactive" => [
                    "type" => "bool",
                    "required" => false
                ],
                "output" => [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "input_schema" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "output_schema" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "settings" =>  [
                    "type" => "assoc",
                    "required" => false,
                    "properties" => [
                        ":any_name:" => [ "type" => "any" ]
                    ]
                ],
                "transitions" =>  [
                    "type" => "assoc",
                    "required" => true,
                    "properties" => [
                        ":any_name:" => [
                            "type" => "enum" ,
                            "required" => false,
                            "one_of" => [ "string", "&transition" ]
                        ]
                    ]
                ]
            ]
        ];
    }
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;
    }
1238724
function schema( $params = array() )
    {
        if ( $this->IsLintChecked )
        {
            return $this->CorrectSchema;
        }

        $params = array_merge( array( 'meta_data' => false,
                                      'format' => 'generic' ),
                               $params );

        $this->CorrectSchema = $this->OtherSchema->schema( $params );
        $this->lintCheckSchema( $this->CorrectSchema );
        $this->IsLintChecked = true;
        return $this->CorrectSchema;
    }
1303286
public function resolve(): array
    {
        if (\is_array($this->schema)) {
            if (isset($this->schema['$ref'])) {
                $ref = $this->schema['$ref'];

                if ($ref === '#') {
                    return $this->rootSchema;
                }
                if (\preg_match('/^#\/[a-z0-9_-]+(\/[a-z0-9_-]+)?$/i', $ref)) {
                    $schema = $this->rootSchema;
                    $path = \explode('/', substr($ref, 2));

                    foreach ($path as $item) {
                        if (!isset($schema[$item])) {
                            throw new ResolveSchemaReferenceException($ref);
                        }
                        $schema = $schema[$item];
                    }
                    return $schema;
                }
                throw new ResolveSchemaReferenceException($ref);
            }
            return $this->schema;
        }
        if (\filter_var(
            $this->schema,
            \FILTER_VALIDATE_URL, \FILTER_FLAG_SCHEME_REQUIRED | \FILTER_FLAG_HOST_REQUIRED
        )) {
            return $this->loadSchema($this->schema);
        }
        throw new ResolveSchemaException();
    }
480261
public function getSchemaData()
    {
        $defaults = $this->getSchemaDataDefaults();
        return array_replace_recursive($defaults, array_intersect_key($this->schemaData, $defaults));
    }
785600
public function createSchema()
    {
        $namespaces = [];

        if ($this->_platform->supportsSchemas()) {
            $namespaces = $this->listNamespaceNames();
        }

        $sequences = [];

        if ($this->_platform->supportsSequences()) {
            $sequences = $this->listSequences();
        }

        $tables = $this->listTables();

        return new Schema($tables, $sequences, $this->createSchemaConfig(), $namespaces);
    }
1347439
public function generate_schema() {
		$schema = "CREATE TABLE `".$this->name."` (\n";
		
		for($i = 0; $i < count($this->details); $i++) {
			
			if(!isset($this->details[$i]['options'])) {
				$this->details[$i]['options'] = array();
			}
			
			$schema .= "`".$this->details[$i]['name']."` ";
			$schema .= $this->type($this->details[$i]);
			$schema .= $this->options($this->details[$i]['options']);
			$schema .= ",\n";
		}
		
		$schema .= $this->table_keys();
		$schema .= ')';
		$schema .= $this->engine();
		
		return $schema;
	}
164063
private function getOrganizeMigrationsModes() : array
    {
        $constPrefix = 'VERSIONS_ORGANIZATION_';
        $prefixLen   = strlen($constPrefix);
        $refClass    = new ReflectionClass('Doctrine\Migrations\Configuration\Configuration');
        $constsArray = $refClass->getConstants();
        $namesArray  = [];

        foreach ($constsArray as $key => $value) {
            if (strpos($key, $constPrefix) !== 0) {
                continue;
            }

            $namesArray[] = substr($key, $prefixLen);
        }

        return $namesArray;
    }
470360
public static function supportedTypes()
    {
        return [
            self::YAML,
            self::JSON,
            self::INI,
            self::COLUMNS,
            self::TABLE,
            self::MARKDOWN,
            self::DUMP
        ];
    }
1356609
public function getAttributes()
    {
        $attributes = parent::getAttributes();

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

        return $attributes;
    }
778052
public function getElasticaFields() {
		$db = \DataObject::database_fields(get_class($this->owner));
		$fields = $this->owner->searchableFields();
		$result = new \ArrayObject();

		foreach ($fields as $name => $params) {
			$type = null;
			$spec = array();

			if (array_key_exists($name, $db)) {
				$class = $db[$name];

				if (($pos = strpos($class, '('))) {
					$class = substr($class, 0, $pos);
				}

				if (array_key_exists($class, self::$mappings)) {
					$spec['type'] = self::$mappings[$class];
				}
			}

			$result[$name] = $spec;
		}
        
        $result['LastEdited'] = array('type' => 'date');
        $result['Created'] = array('type' => 'date');
        $result['ID']       = array('type' => 'integer');

        $result['ParentID'] = array('type' => 'integer');
        $result['Sort'] = array('type' => 'integer');
        
        $result['Name'] = array('type' => 'string');
        $result['MenuTitle'] = array('type' => 'string');
        $result['ShowInSearch'] = array('type' => 'integer');
        
        $result['ClassName'] = array('type' => 'string');
        $result['ClassNameHierarchy'] = array('type' => 'string');

        $result['SS_Stage'] = array('type' => 'keyword');

        $result['PublicView'] = array('type' => 'boolean');

        if ($this->owner->hasExtension('Hierarchy') || $this->owner->hasField('ParentID')) {
            $result['ParentsHierarchy'] = array('type' => 'long',);
        }

        // fix up dates
        foreach ($result as $field => $spec) {
            if (isset($spec['type']) && ($spec['type'] == 'date')) {
                $spec['format'] = 'yyyy-MM-dd HH:mm:ss';
                $result[$field] = $spec;
            }
        }

        if (isset($result['Content']) && count($result['Content'])) {
            $spec = $result['Content'];
            $spec['store'] = false;
            $result['Content'] = $spec;
        }
        $this->owner->invokeWithExtensions('updateElasticMappings', $result);
        
		return $result->getArrayCopy();
	}
446006
public function getSchema()
    {
        $this->output->writeln('Load current database schema.');
        $result = [];

        $result['database'] = $this->getDatabaseSchemata($this->dbName);

        $tables = $this->getTables();
        foreach ($tables as $table) {
            $tableName = $table['table_name'];
            $this->output->writeln(sprintf('Table: <info>%s</info>', $tableName));
            $result['tables'][$tableName]['table'] = $table;
            $result['tables'][$tableName]['columns'] = $this->getColumns($tableName);
            $result['tables'][$tableName]['indexes'] = $this->getIndexes($tableName);
            $result['tables'][$tableName]['foreign_keys'] = $this->getForeignKeys($tableName);
        }

        return $result;
    }
1252502
public function getDynamicSchemaExample(): array
    {
        $site = Site::instance('1', 'JSON API Samples', []);

        $encoder = Encoder::instance([
            Site::class => SiteSchema::class,
        ])->withEncodeOptions(JSON_PRETTY_PRINT);

        SiteSchema::$isShowCustomLinks = false;
        $noLinksResult                 = $encoder->encodeData($site);

        SiteSchema::$isShowCustomLinks = true;
        $withLinksResult               = $encoder->encodeData($site);

        return [
            $noLinksResult,
            $withLinksResult,
        ];
    }
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' => [],
        ];
    }
657909
public function get_item_schema() {
		$schema = array(
			'$schema'              => 'http://json-schema.org/draft-04/schema#',
			'title'                => 'type',
			'type'                 => 'object',
			'properties'           => array(
				'capabilities'     => array(
					'description'  => __( 'All capabilities used by the resource.' ),
					'type'         => 'array',
					'context'      => array( 'edit' ),
					'readonly'     => true,
				),
				'description'      => array(
					'description'  => __( 'A human-readable description of the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit' ),
					'readonly'     => true,
				),
				'hierarchical'     => array(
					'description'  => __( 'Whether or not the resource should have children.' ),
					'type'         => 'boolean',
					'context'      => array( 'view', 'edit' ),
					'readonly'     => true,
				),
				'labels'           => array(
					'description'  => __( 'Human-readable labels for the resource for various contexts.' ),
					'type'         => 'object',
					'context'      => array( 'edit' ),
					'readonly'     => true,
				),
				'name'             => array(
					'description'  => __( 'The title for the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit', 'embed' ),
					'readonly'     => true,
				),
				'slug'             => array(
					'description'  => __( 'An alphanumeric identifier for the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit', 'embed' ),
					'readonly'     => true,
				),
			),
		);
		return $this->add_additional_fields_schema( $schema );
	}
115508
public static function schema(){
        $classname = get_called_class();
        if(!array_key_exists($classname, self::$schemas)){
            $schema = new SchemaBuilder(static::table());
            static::define($schema);
            self::$schemas[$classname] = $schema;
        }
        return self::$schemas[$classname];
    }
15519
public function getDefAsArray()
    {
        return [
            'length'                => $this->definition->getLength(),
            'title'                 => $this->definition->getTitle(),
            'description'           => $this->definition->getDescription(),
            'readOnly'              => $this->definition->getReadOnly(),
            'hidden'                => $this->definition->getHidden(),
            'recordOriginException' => $this->definition->isRecordOriginException(),
            'required'              => $this->definition->getRequired(),
            'searchable'            => $this->definition->getSearchable(),
            'translatable'          => $this->definition->getTranslatable(),
            'collection'            => $this->definition->getCollection(),
            'groups'                => $this->definition->getGroups(),
            'restrictions'          => $this->definition->getRestrictions(),
            'onVariation'           => $this->definition->getOnVariation(),

            'name'                  => $this->getName(),
            'type'                  => $this->getType(),
            'exposedName'           => $this->getExposedName(),
            'doctrineType'          => $this->getTypeDoctrine(),
            'serializerType'        => $this->getTypeSerializer(),
            'xDynamicKey'           => $this->getXDynamicKey(),
            'relType'               => null,
            'isClassType'           => false,
            'constraints'           => array_map(
                [Utils\ConstraintNormalizer::class, 'normalize'],
                $this->definition->getConstraints()
            ),
        ];
    }