ArticleTypeField::fetch PHP Метод

fetch() публичный Метод

Fetch a single record from the database for the given key.
public fetch ( array $p_recordSet = null, $p_forceExists = false ) : boolean
$p_recordSet array If the record has already been fetched and we just need to assign the data to the object's internal member variable.
Результат boolean TRUE on success, FALSE on failure
    public function fetch($p_recordSet = null, $p_forceExists = false)
    {
        $success = parent::fetch($p_recordSet);
        if ($success && $this->getType() == self::TYPE_NUMERIC) {
            $params = explode('=', $this->m_data['field_type_param']);
            if (isset($params[0]) && $params[0] == 'precision') {
                $this->m_precision = (int) $params[1];
            }
        }
        if ($success && $this->getType() == self::TYPE_BODY) {
            $params = explode('=', $this->m_data['field_type_param']);
            if (isset($params[0]) && $params[0] == 'editor_size') {
                $this->m_editorSize = (int) $params[1];
            }
        }
        if ($success && $this->getType() == self::TYPE_COMPLEX_DATE) {
            $params = explode(';', $this->m_data['field_type_param']);
            foreach ($params as $one_param) {
                $one_param_parts = explode('=', $one_param);
                if (isset($one_param_parts[1]) && $one_param_parts[0] == 'color') {
                    $this->m_colorValue = '' . $one_param_parts[1];
                }
            }
        }
        if ($success && !$this->getType()) {
            $params = explode(';', $this->m_data['field_type_param']);
            foreach ($params as $one_param) {
                $one_param_parts = explode('=', $one_param);
                if (isset($one_param_parts[1]) && $one_param_parts[0] == 'filter') {
                    $this->m_filterOut = (bool) ('' . $one_param_parts[1]);
                }
            }
        }
        return $success;
    }