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

@return array
480261
public function getSchemaData()
    {
        $defaults = $this->getSchemaDataDefaults();
        return array_replace_recursive($defaults, array_intersect_key($this->schemaData, $defaults));
    }
1224088
private function schema() {
		
		//todo: consider caching this
		$expanded_tables = [];
		$tables = config('center.tables', []);

		foreach ($tables as $table=>$table_properties) {
			
			//sanitize for use in db names and php functions
			$table = str_slug($table, '_');

			//parse table definition
			$table_properties = self::associateNumericKeys($table_properties);
			$table_properties['name'] = $table;
			$table_properties['title'] = trans('center::' . $table . '.title');
			if (!isset($table_properties['keep_clean'])) $table_properties['keep_clean'] = false;
			if (!isset($table_properties['creatable'])) $table_properties['creatable'] = true;
			if (!isset($table_properties['editable'])) $table_properties['editable'] = true;
			if (!isset($table_properties['deletable'])) $table_properties['deletable'] = true;
			if (!isset($table_properties['list'])) $table_properties['list'] = [];
			if (!isset($table_properties['export'])) $table_properties['export'] = [];
			if (!isset($table_properties['search'])) $table_properties['search'] = [];
			if (!isset($table_properties['filters'])) $table_properties['filters'] = [];
			if (!isset($table_properties['timestamps'])) $table_properties['timestamps'] = true;
			
			//temp, soon to look up from permissions table
			$table_properties['dates'] = [];
			
			//loop through fields
			if (!isset($table_properties['fields'])) $table_properties['fields'] = [];
			$expanded_fields = [];
			foreach ($table_properties['fields'] as $field=>$field_properties) {
				
				//resolve shorthand, eg 'updated_at'
				if (is_int($field)) $field = $field_properties;
				if (is_string($field_properties)) {
					if (strpos($field_properties, ' ') !== false) {
						$parts = explode(' ', $field_properties);
						$field_properties = [
							'required' => in_array('required', $parts),
							'hidden' => in_array('hidden', $parts),
							'type' => implode(array_diff($parts, ['required', 'hidden'])),
						];
					} else {
						$field_properties = ['type' => $field_properties];
					}
				}
				$field_properties = self::associateNumericKeys($field_properties);

				//set types on reserved system fields
				if ($field == 'permissions') $field_properties['type'] = 'permissions';
				if (in_array($field, ['created_at', 'updated_at', 'deleted_at'])) $field_properties['type'] = 'datetime';
				if (in_array($field, ['id', 'created_by', 'updated_by', 'deleted_by', 'precedence'])) $field_properties['type'] = 'integer';
				
				//check field type is supported
				if (!in_array($field_properties['type'], self::$field_types)) {
					trigger_error('field ' . $table . '.' . $field . ' is of type ' . $field_properties['type'] . ' which is not supported.');
				}
				
				//relationship columns always end in _id, eg image_id
				//this is so that $model->image_id and $model->image->src can work
				if (in_array($field_properties['type'], ['image', 'select', 'user'])) {
					if (!ends_with($field, '_id')) $field .= '_id';
				}

				//set other field attributes
				$field_properties['name'] = $field;
				$field_properties['title'] = trans('center::' . $table . '.fields.' . $field);
				if (!isset($field_properties['required'])) {
					if (in_array($field, ['id', 'created_at', 'updated_at'])) {
						$field_properties['required'] = true;
					} elseif (in_array($field_properties['type'], ['checkbox'])) {
						$field_properties['required'] = true;
					} else {
						$field_properties['required'] = false;
					}
				}

				//in general, the name of a checkboxes field should be the name of its joining table
				//however your are allowed to name the source, and let the system set the joining table for you
				if (($field_properties['type'] == 'checkboxes') && empty($field_properties['source'])) {
					$field_properties['source'] = $field;
					$field = $field_properties['name'] = RowController::formatJoiningTable($table, $field);
				}
				
				if ($field_properties['type'] == 'user') $field_properties['source'] = config('center.db.users');

				//field max lengths
				if ($field_properties['type'] == 'phone') $field_properties['maxlength'] = 10;
				if ($field_properties['type'] == 'zip') $field_properties['maxlength'] = 5;
				if ($field_properties['type'] == 'us_state') $field_properties['maxlength'] = 2;
				if ($field_properties['type'] == 'country') $field_properties['maxlength'] = 2;
				
				if (!isset($field_properties['hidden'])) $field_properties['hidden'] = in_array($field, ['id', 'created_at', 'updated_at', 'deleted_at', 'created_by', 'updated_by', 'deleted_by', 'password', 'precedence']);
				if (in_array($field_properties['type'], ['image' ,'images'])) {
					if (empty($field_properties['width'])) $field_properties['width'] = null;
					if (empty($field_properties['height'])) $field_properties['height'] = null;
				}

				//empty source on 
				if (in_array($field_properties['type'], ['latitude', 'longitude', 'slug'])) {
					if (empty($field_properties['source'])) $field_properties['source'] = null;
				}
				
				//forced overrides
				if ($field_properties['type'] == 'password') $field_properties['hidden'] = true;
				if ($field_properties['hidden']) $field_properties['required'] = false;
				
				//save
				$expanded_fields[$field] = (object) $field_properties;
				
			}
			
			//save fields to table as an object
			$table_properties['fields'] = (object) $expanded_fields;

			//default table properties
			if (!isset($table_properties['list_grouping'])) $table_properties['list_grouping'] = '';
			if (!isset($table_properties['model'])) $table_properties['model'] = studly_case(str_singular($table));
			if (!isset($table_properties['hidden'])) $table_properties['hidden'] = false;
			if (!isset($table_properties['links'])) $table_properties['links'] = [];
			if (!isset($table_properties['order_by'])) {
				$table_properties['order_by'] = [$table . '.id'=>'asc'];
			} else {
				$table_properties['order_by'] = self::associateNumericKeys($table_properties['order_by'], 'asc');
				foreach ($table_properties['order_by'] as $column => $direction) {
					//add table name to disambiguate
					if (!strstr($column, '.')) {
						unset($table_properties['order_by'][$column]);
						$table_properties['order_by'][$table . '.' . $column] = $direction;
					}
				}
			}

			//save table to $tables array as an object
			$expanded_tables[$table] = (object) $table_properties;
		}

		//sort alpha by title
		uksort($expanded_tables, function($a, $b) use ($expanded_tables) {
			return $expanded_tables[$a]->title > $expanded_tables[$b]->title;
		});

		//dd($expanded_tables);

		Config::set('center.tables', $expanded_tables);		
	}
980875
public function getStoreFields()
    {
        $schemaManager = $this->connection->getDriver()->getSchemaManager($this->connection);
        $columns       = array();
        $sql           = $schemaManager->getDatabasePlatform()->getListTableColumnsSQL($this->tableName, $this->connection->getDatabase());
        $all           = $this->connection->fetchAll($sql);

        foreach ($all as $fieldInfo) {
            $columns[] = $fieldInfo["name"];
        }
        return $columns;
    }
975842
public function getSaveData()
    {
        $this->defineFormFields();

        $result = [];

        /*
         * Source data
         */
        $data = $this->arrayName ? post($this->arrayName) : post();
        if (!$data) {
            $data = [];
        }

        /*
         * Spin over each field and extract the postback value
         */
        foreach ($this->allFields as $field) {
            /*
             * Disabled and hidden should be omitted from data set
             */
            if ($field->disabled || $field->hidden) {
                continue;
            }

            /*
             * Handle HTML array, eg: item[key][another]
             */
            $parts = HtmlHelper::nameToArray($field->fieldName);
            if (($value = $this->dataArrayGet($data, $parts)) !== null) {

                /*
                 * Number fields should be converted to integers
                 */
                if ($field->type === 'number') {
                    $value = !strlen(trim($value)) ? null : (float) $value;
                }

                $this->dataArraySet($result, $parts, $value);
            }
        }

        /*
         * Give widgets an opportunity to process the data.
         */
        foreach ($this->formWidgets as $field => $widget) {
            $parts = HtmlHelper::nameToArray($field);

            $widgetValue = $widget->getSaveValue($this->dataArrayGet($result, $parts));
            $this->dataArraySet($result, $parts, $widgetValue);
        }

        return $result;
    }
846682
public function toArray()
    {
        $schema_options = array(
            'unique_field' => $this->_uniqueField,
            'fields' => array(),
        );
        foreach ($this->_fields as $id => $field) {
            $schema_options['fields'][$id] = $field->toArray();
        }
        return $schema_options;
    }
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;
    }
1311554
public function get_item_schema() {
		$schema = array(
			'$schema'    => 'http://json-schema.org/draft-04/schema#',
			'title'      => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy,
			'type'       => 'object',
			'properties' => array(
				'id'          => array(
					'description'  => __( 'Unique identifier for the resource.' ),
					'type'         => 'integer',
					'context'      => array( 'view', 'embed', 'edit' ),
					'readonly'     => true,
				),
				'count'       => array(
					'description'  => __( 'Number of published posts for the resource.' ),
					'type'         => 'integer',
					'context'      => array( 'view', 'edit' ),
					'readonly'     => true,
				),
				'description' => array(
					'description'  => __( 'HTML description of the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit' ),
					'arg_options'  => array(
						'sanitize_callback' => 'wp_filter_post_kses',
					),
				),
				'link'        => array(
					'description'  => __( 'URL to the resource.' ),
					'type'         => 'string',
					'format'       => 'uri',
					'context'      => array( 'view', 'embed', 'edit' ),
					'readonly'     => true,
				),
				'name'        => array(
					'description'  => __( 'HTML title for the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'embed', 'edit' ),
					'arg_options'  => array(
						'sanitize_callback' => 'sanitize_text_field',
					),
					'required'     => true,
				),
				'slug'        => array(
					'description'  => __( 'An alphanumeric identifier for the resource unique to its type.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'embed', 'edit' ),
					'arg_options'  => array(
						'sanitize_callback' => array( $this, 'sanitize_slug' ),
					),
				),
				'taxonomy'    => array(
					'description'  => __( 'Type attribution for the resource.' ),
					'type'         => 'string',
					'enum'         => array_keys( get_taxonomies() ),
					'context'      => array( 'view', 'embed', 'edit' ),
					'readonly'     => true,
				),
			),
		);
		$taxonomy = get_taxonomy( $this->taxonomy );
		if ( $taxonomy->hierarchical ) {
			$schema['properties']['parent'] = array(
				'description'  => __( 'The id for the parent of the resource.' ),
				'type'         => 'integer',
				'context'      => array( 'view', 'edit' ),
			);
		}

		$schema['properties']['meta'] = $this->meta->get_field_schema();
		return $this->add_additional_fields_schema( $schema );
	}
31035
public function __toArray()
    {
        $data = array();

        foreach (static::schema() as $field => $options) {
            $data[$field] = $this->{$field};
        }

        return $data;
    }
345381
public function getDataForm(): array
    {
        $data = [];
        foreach ($this->dicionario as $meta) {
            if($meta->getFormat() === "password") {
                $data[$meta->getColumn()] = "";
            } else {
                $data[$meta->getColumn()] = $meta->getValue();
            }
        }

        return $data;
    }
530103
public function getExportFields()
    {
        $fields = array();
        foreach (DataObject::getSchema()->databaseFields($this->modelClass) as $field => $spec) {
            $fields[$field] = $field;
        }
        return $fields;
    }
345276
protected function loadFormData()
	{
		// Check the session for previously entered form data.
		$app = JFactory::getApplication();
		$data = $app->getUserState('com_categories.edit.' . $this->getName() . '.data', array());

		if (empty($data))
		{
			$data = $this->getItem();

			// Pre-select some filters (Status, Language, Access) in edit form if those have been selected in Category Manager
			if (!$data->id)
			{
				// Check for which extension the Category Manager is used and get selected fields
				$extension = substr($app->getUserState('com_categories.categories.filter.extension'), 4);
				$filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter');

				$data->set(
					'published',
					$app->input->getInt(
						'published',
						((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)
					)
				);
				$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
				$data->set(
					'access',
					$app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))
				);
			}
		}

		$this->preprocessData('com_categories.category', $data);

		return $data;
	}
979368
public function getData()
    {
        if (empty($this->data)) {
            $this->data = [
                'entityClassName' => $this->getEntityClassName(),
                'entityName' => $this->getEntityName(),
                'formFilename' => lcfirst($this->getEntityName()).'-form'
            ];
        }
        return $this->data;
    }
56439
protected static function getSchemaFields()
    {
        $attribute = 'schema-fields';

        if (!static::hasClassAttribute($attribute)) {
            $allFields = static::getAllFields();
            $excludeFields = static::getExcludeFields();
            $schemaFields = array_diff($allFields, $excludeFields);

            static::setClassAttribute($attribute, $schemaFields);
        }

        return static::getClassAttribute($attribute);
    }
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;
	}
603274
protected function getData()
    {
        $data = [];
        foreach ($this->_schema as $name => $desc) {
            $data[$name] = $this->$name;
            if (isset($desc['updateDate']) && $desc['updateDate']) {
                $data[$name] = new MongoDate();
            }
        }
        if ($data['_id'] === null) {
            // @codeCoverageIgnoreStart
            unset($data['_id']);
            // @codeCoverageIgnoreEnd
        }
        return $data;
    }
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' => [],
        ];
    }
533083
public function getDataAttributes()
    {
        $attributes = [];
        
        foreach ($this->getFieldConfig() as $key => $value) {
            $attributes[sprintf('data-%s', $key)] = $this->getDataValue($value);
        }
        
        return $attributes;
    }