Get field data by field name or key.

@param  string $field Field name or key
@return array         Field data

@throws \Exception If field does not exist
420231
private function getFieldData($field)
    {
        if (!isset($this->_fieldData[$field])) {
            foreach ($this->fields as $f) {
                if (($f['key'] === $field) || ($f['name'] === $field)) {
                    $this->_fieldData[$field] = $f;
                    break;
                }
            }
        }

        if (isset($this->_fieldData[$field])) {
            return $this->_fieldData[$field];
        } else {
            throw new Exception("Field $field does not exist");
        }
    }
195566
protected function getFields()
    {
        if (is_null($this->fields)) {
            $columns = $this->getColumns();

            if (empty($columns)) {
                throw new Exception('The table ' . $this->tableName . ' was not found in the ' . $this->databaseName . ' database.');
            }

            $this->fields = $this->transfer($columns);
        }

        return $this->fields;
    }
519341
public function getFieldData(Field $field)
    {
        $field->value->externalData = $this->getAssignedKeywords($field->id);
    }
271176
protected function getValue($field) {
		$value = null;
		$readField = 'get'.$field;

		foreach($this->readProfiles as $profile) {
			
			$value = $profile->$readField();
			if($value !== null) {
				$this->setValue($field, $value);
				break;
			}
		}
		

		return $value;
	}
28622
public function get($field = null)
    {
        if ($field === null) {

            // Collect list of eligible fields
            $data = [];
            if ($this->only_fields) {
                // collect data for actual fields
                foreach ($this->only_fields as $field) {
                    $data[$field] = $this->get($field);
                }
            } else {
                // get all field-elements
                foreach ($this->elements as $field => $f) {
                    if ($f instanceof Field) {
                        $data[$field] = $this->get($field);
                    }
                }
            }

            return $data;
        }

        $field = $this->normalizeFieldName($field);

        if (array_key_exists($field, $this->data)) {
            return $this->data[$field];
        }

        $f = $this->hasField($field);

        return $f ? $f->default : null;
    }
1142127
protected function get($field)
    {
        $map = $this->_config['fieldMap'];
        if (isset($map[$field])) {
            $field = $map[$field];
        }

        if (isset($this->data[$field])) {
            return $this->data[$field];
        }

        return null;
    }
44292
protected function computeExtractFieldName($field)
    {
        if ($this->hasNamingStrategy()) {
            $field = $this->getNamingStrategy()->extract($field);
        }
        return $field;
    }
1019538
private function getMaterialField($field)
    {
        if (isset($this->fields[$field['name']]) && is_object($this->fields[$field['name']]))
            return $this->fields[$field['name']];
            
        $slot = new Cache\Slot\MaterialField($this->table, $this->fields['id'], $field['name']);
        if (!$this->fields['id'] || false === ($_tmp = $slot->load())) {        
    
            if (!isset($this->fields[$field['name']]))
                $this->fields[$field['name']] = $this->getPlainField($field);

            if ($this->fields[$field['name']]) {
				
				try {
				
					if ($field['pseudo_type'] == PSEUDO_FIELD_LINK_CATALOG) {
						 $this->fields[$field['name']] = Catalog::getById($this->fields[$field['name']]);
					}
					elseif ($field['pseudo_type'] == PSEUDO_FIELD_LINK_USER) {   
						   $this->fields[$field['name']] = User::getById($this->fields[$field['name']]);  
					} 
					else {
									
						if ($field['type'] == FIELD_LINK) {
							if ($field['len']) {
								$c = Catalog::getById($field['len']);
								if (!$c) throw new Exception\CMS('Catalog '.$field['len'].' is not found.');
								$type = $c->materialsType;
							} else $type = $this->objectDefinition->id;
						} else {
							$type = $field['len'];
						}
						
						$this->fields[$field['name']] = self::getByIdType( $this->fields[$field['name']], $type );
					
					}
					
				}
				catch (\Exception $e) {
					$this->fields[$field['name']] = null;
				}
            
            } else {
                
                $this->fields[$field['name']] = null;
                
            }
            
            $slot->addTag(new Cache\Tag\Material($this->table, $this->fields['id']));
            $slot->save($this->fields[$field['name']]);
        } else {
            $this->fields[$field['name']] = $_tmp;
        }
        
        return $this->fields[$field['name']];
    }
901839
public function getField($field)
    {
        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            throw new \LogicException(sprintf('Undefined field %s.', $field));
        }

        return $fields[$field];
    }
523585
public function field($field)
    {
        return $this->fieldFactory->createFromField(
            $this->getFieldData($field),
            $this->getFieldValue($field)
        );
    }
1278102
public function getUserField($field)
    {
        //$cache = self::getCacheFactory();
        //return unserialize($cache->load($this->getFieldCacheKey($field)));

        if (isset(self::$cachedFields[$this->ID][$field])) {
            return self::$cachedFields[$this->ID][$field];
        } elseif ($userField = $this->Fields()->find('Name', $field)) {
            return self::$cachedFields[$this->ID][$field] = (string)$userField->getField('Value');
        }

        return null;
    }
470262
private function getPlainField($field)
    {
        if (!isset($this->fields[$field['name']])) {                     
			$this->fields[$field['name']] = $this->getDbConnection()->fetchColumn('SELECT `'.$field['name'].'` FROM '.$this->table.' WHERE id='.(int)$this->fields['id']);
		}
        return $this->fields[$field['name']];
    }
995033
public function getField($field_name)
    {
        $field = null;
        
        if (isset($this->m_fields[$field_name]))
        {
            $field = $this->m_fields[$field_name];
        }
        else
        {
            $err_msg = '[' . $field_name . '] does not exist in table ' .
                       '[' . $this->m_name . ']';
            
            throw new \Exception($err_msg);
        }
        
        return $field;
    }
699148
protected function getFieldValue($field, $data)
    {
        $value = null;
        if (isset($data[$field['name']])) {
            $value = $data[$field['name']];
        }
        return $value;
    }
472901
public function offsetGet($field) {
        if (isset($this->values[$field]) || $this->load($field)) {
            return $this->values[$field];
        }

        return NULL;
    }
639435
public function getField($field)
    {
        if (isset($this->allFields[$field])) {
            return $this->allFields[$field];
        }

        return null;
    }
684982
public function getField(string $field)
    {
        if (isset($this->_record[$field]))
            return $this->_record[$field];
        return null;
    }