Setup field data from the storage.

@return void
324900
protected function setup_data() {
		if ( ! $storage = $this->get_storage() ) {
			return;
		}

		$_hash = spl_object_hash( $storage );

		if ( $storage instanceof Deferred_Storage && ! isset( static::$storages_was_read[ $_hash ] ) ) {
			$storage->read();
			static::$storages_was_read[ $_hash ] = true;
		}

		$this->set_value(
			$storage->get( $this->get_map_key() )
		);
	}
1331470
protected function setup_storage() {
		$storage = $this->get_option( 'storage' );

		if ( 'option' === $storage ) {
			$storage = Option_Storage::get_instance();
		} elseif ( 'thememod' === $storage ) {
			$storage = Theme_Mod_Storage::get_instance();
		} elseif ( is_string( $storage ) && is_subclass_of( $storage, Storage::class ) ) {
			$storage = new $storage;
		} elseif ( is_callable( $storage ) ) {
			$storage = $storage( $this );
		}

		if ( $storage instanceof Storage ) {
			$this->set_storage( $storage );
		}
	}
263051
protected function setFields()
    {
        $this->set = new \stdClass();
        $schema    = $this->schema();

        foreach ($schema as $field => $type)
        {
            if (Helpers\Validate::isNumeric($type) && $field != 'id')
            {
                $this->setField($field, 0);
            }
            else
            {
                $this->setField($field, null);
            }
        }
    }
134480
public void setupSFields()
    {
        Record record = this.getMainRecord();
        BaseField field = record.getField(DBConstants.MAIN_FIELD);
        if (field == record.getCounterField())
            field.setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY);
        super.setupSFields();
    }
1141597
public void setupSFields()
    {
        this.getRecord(UserInfo.USER_INFO_FILE).getField(UserInfo.USER_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
65781
public void setupSFields()
    {
        this.getRecord(Folder.FOLDER_FILE).getField(Folder.NAME).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
1325416
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, SEQUENCE, 10, null, new Integer(1000));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, METHOD_NAME, 40, null, null);
        field = new FieldInfo(this, LOGIC_DESCRIPTION, 32000, null, null);
        field = new FieldInfo(this, METHOD_RETURNS, 255, null, null);
        field = new FieldInfo(this, METHOD_INTERFACE, 255, null, null);
        field = new FieldInfo(this, METHOD_CLASS_NAME, 40, null, null);
        field = new FieldInfo(this, LOGIC_SOURCE, 32000, null, null);
        field = new FieldInfo(this, LOGIC_THROWS, 255, null, null);
        field = new FieldInfo(this, PROTECTION, 60, null, null);
        field = new FieldInfo(this, COPY_FROM, 40, null, null);
        field = new FieldInfo(this, INCLUDE_SCOPE, 10, null, new Integer(0x004));
        field.setDataClass(Integer.class);
    }
25806
private function bindFields()
    {
        foreach ($this->fields as $key => $value) {
            $this->statement->bindValue(':' . $key, $value);
        }
    }
216870
public void setupSFields()
    {
        Converter converter = new FieldLengthConverter(this.getMainRecord().getField(Resource.CODE), 60);
        new SEditText(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this,converter, ScreenConstants.DEFAULT_DISPLAY);
        this.getRecord(Resource.RESOURCE_FILE).getField(Resource.DESCRIPTION).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY);
    }
89208
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, START_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Object.class);
        field = new FieldInfo(this, END_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Object.class);
        field = new FieldInfo(this, START_PARENT_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Object.class);
        field = new FieldInfo(this, END_PARENT_ICON, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Object.class);
        field = new FieldInfo(this, TASK_COLOR, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, TASK_SELECT_COLOR, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PARENT_TASK_COLOR, 10, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PARENT_TASK_SELECT_COLOR, 10, null, null);
        field.setDataClass(Integer.class);
    }
364537
private function setCustomFields()
    {
        $customFieldCollection = new CustomFieldCollection();

        if (isset($this->simpleXml->{'custom-fields'})) {
            /** @var SimpleXMLElement $field */
            foreach ($this->simpleXml->{'custom-fields'}->children() as $field) {
                $customField = $this->convertToCustomField($field);
                if (!is_null($customField)) {
                    $customFieldCollection->add($customField);
                }
            }
        }
        $this->customFields = $customFieldCollection;
    }
240600
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, USER_GROUP_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, USER_RESOURCE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, LOGIN_LEVEL, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, ACCESS_LEVEL, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
893825
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, NAME, 120, null, null);
        field = new FieldInfo(this, PARENT_PROJECT_TASK_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, SEQUENCE, 5, null, new Short((short)0));
        field.setDataClass(Short.class);
        field = new FieldInfo(this, COMMENT, 32000, null, null);
        field = new FieldInfo(this, CODE, 30, null, null);
        field = new FieldInfo(this, START_DATE_TIME, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, DURATION, 15, null, new Double(1));
        field.setDataClass(Double.class);
        field.setScale(-1);
        //field = new FieldInfo(this, END_DATE_TIME, 25, null, null);
        //field.setDataClass(Date.class);
        field = new FieldInfo(this, PROGRESS, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Float.class);
        field = new FieldInfo(this, PROJECT_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROJECT_VERSION_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROJECT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROJECT_STATUS_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ASSIGNED_USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, PROJECT_PRIORITY_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, ENTERED_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, ENTERED_BY_USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CHANGED_DATE, 25, null, null);
        field.setDataClass(Date.class);
        field = new FieldInfo(this, CHANGED_BY_USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, HAS_CHILDREN, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
    }
827685
protected function _setupSort()
    {
        if (!($this->_sortEnabled = $this->_isSortEnabled())) {
            return;
        }

        $this->sortFields = $this->_getSortFields();

        foreach ($this->sortFields as $field => $options) {
            if (!isset($options['default'])) {
                continue;
            }
            $dir = strtolower($options['default']);
            if (in_array($dir, ['asc', 'desc'])) {
                $this->defaultSort = [
                    'field' => $field,
                    'dir' => $dir
                ];
            }
        }
    }
1015037
protected function _setup()
    {
        parent::_setup();

        $this->_setupPrimaryAssignment();
        $this->setLifetime($this->_lifetime);

        $this->_checkRequiredColumns();
    }
595519
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, DESCRIPTION, 30, null, null);
        field = new FieldInfo(this, CODE, 20, null, null);
        field = new FieldInfo(this, NAMESPACE, 128, null, null);
        field = new FieldInfo(this, SCHEMA_LOCATION, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, NUMERIC_VERSION, 20, null, null);
        field = new FieldInfo(this, VERSION_ID, 20, null, null);
        field = new FieldInfo(this, PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
    }
1311190
public void setupFields()
    {
        FieldInfo field = null;
        field = new FieldInfo(this, ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field.setHidden(true);
        field = new FieldInfo(this, LAST_CHANGED, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Date.class);
        field.setHidden(true);
        field = new FieldInfo(this, DELETED, 10, null, new Boolean(false));
        field.setDataClass(Boolean.class);
        field.setHidden(true);
        field = new FieldInfo(this, DESCRIPTION, 50, null, null);
        field = new FieldInfo(this, CODE, 30, null, null);
        field = new FieldInfo(this, MESSAGE_CLASS, 127, null, null);
        field = new FieldInfo(this, MESSAGE_PROPERTIES, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field = new FieldInfo(this, MESSAGE_INFO_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(1));
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REVERSE_MESSAGE_INFO_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, CONTACT_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
        field = new FieldInfo(this, REQUEST_TYPE_ID, Constants.DEFAULT_FIELD_LENGTH, null, null);
        field.setDataClass(Integer.class);
    }