@param Field $field

@return array|string

@throws SolrMappingException if getter return value is object
542165
private function mapObjectField(Field $field)
    {
        $value = $field->getValue();
        $getter = $field->getGetterName();
        if (empty($getter)) {
            throw new SolrMappingException(sprintf('Please configure a getter for property "%s" in class "%s"', $field->name, get_class($value)));
        }
        
        $getterReturnValue = $this->callGetterMethod($value, $getter);

        if (is_object($getterReturnValue)) {
            throw new SolrMappingException(sprintf('The configured getter "%s" in "%s" must return a string or array, got object', $getter, get_class($value)));
        }

        return $getterReturnValue;
    }
899535
public function get($field)
    {
        if (!is_null($this->filtered) && ! is_null($this->filtered[0])) {
            return isset($this->filtered[0][0][$field]) ? $this->filtered[0][0][$field] : null;
        }

        // Todo: Get values of entities
    }
472686
final public function getRowFieldValue($field)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            return $this->schema[$field]->Value;
        }
        return null;
    }
818017
public function hasHeader($field)
    {
        $ucField = strtoupper($field);

        return isset($this->ucHeaders[$ucField]) || ($ucField === 'SET-COOKIE' && $this->cookies);
    }
1170604
public static function transform_image_fields( &$field ) {
		if ( empty( $field['value'] ) ) {
			return $field['value'];
		}

		foreach ( $field['sub_fields'] as $sub_field ) {
			if ( 'image' === $sub_field['type'] && 'id' === $sub_field['return_format'] ) {
				foreach ( $field['value'] as $id => $item ) {
					$field['value'][ $id ][ $sub_field['name'] ] =
						Image::get_image_fields( $field, $item[ $sub_field['name'] ], $sub_field['name'] );
				}
			}
		}
	}
664179
public function fieldQuery($field)
    {
        $query = $this->dsql()->del('fields');
        if (is_string($field)) {
            $field = $this->getElement($field);
        }
        $field->updateSelectQuery($query);

        return $query;
    }
163812
public function value($field)
    {
        if (is_array($field)) {
            $values = array();
            foreach ($field as $key => $value) {
                $values[$key] = $this->value($value);
            }

            return $values;
        }

        return ($this->submitted && isset($this->values[$field])) ? $this->values[$field] : null;
    }
572550
public function format($field = null, $format = null)
    {
        $numArgs = func_num_args();

        if ($numArgs === 0) {
            $formatter = $this->collection->option('format');

            if (is_null($formatter)) {
                $schema = $this->schemaByIndex(0);
                if (!is_null($schema)) {
                    return (isset($this[$schema['name']])) ? val($this[$schema['name']]) : null;
                } else {
                    return '-- no formatter and schema --';
                }
            } else {
                if ($formatter instanceof Closure) {
                    return $formatter($this);
                } elseif (is_string($formatter)) {

                    $result = preg_replace_callback('/{(\w+)}/', function($matches) {
                        return $this->format($matches[1]);
                    }, $formatter);

                    return $result;
                } else {
                    throw new Exception('Unknown format for Model formatter.');
                }
            }
        } else {
            $format = $format ?: 'plain';

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

            // TODO return value if no formatter or just throw exception?
            if (is_null($schema)) {
                throw new Exception("[Norm/Model] No formatter [$format] for field [$field].");
            } else {
                $value = isset($this[$field]) ? val($this[$field]) : null;
                return $schema->format($format, $value, $this);
            }
        }
    }
297329
protected function getMethodParamerters(Field $field)
    {
        $params = count($field->methodParams) == 0 ? '' : ', ' . implode(',', $field->methodParams);

        if ($field->getEloquentDataMethod() == 'enum') {
            $params = ', ' . $this->getEnumParams($field);
        }

        return $params;
    }
924604
public function map(Field $field)
    {
        if ($field->value['latitude'] === null || $field->value['longitude'] === null) {
            return null;
        }

        return sprintf('%F,%F', $field->value['latitude'], $field->value['longitude']);
    }
435232
public function getField($field)
    {
        // Skip invalid fields
        $fields = $this->compositeDatabaseFields();
        if (!isset($fields[$field])) {
            return null;
        }

        // Check bound object
        if ($this->record instanceof DataObject) {
            $key = $this->getName() . $field;
            return $this->record->getField($key);
        }

        // Check local record
        if (isset($this->record[$field])) {
            return $this->record[$field];
        }
        return null;
    }
436192
public function get($field)
    {
        $client = $this->getClient();

        return $client->hget($this->getKey()->getName(), $field);
    }
540510
public static function getField($field)
    {
        return isset(self::$fields[$field]) ? self::$fields[$field] : null;
    }
399591
public function to($field)
    {
        if ($field instanceof FieldBuilderBase) {
            $field = $field->build();
        }

        call_user_func($this->callback, $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']];
    }
810666
public static function transform_to_object( &$field ) {
		if ( 1 !== count( $field['value'] ) ) {
			return $field['value'];
		}

		$as_array = ! ( 1 === $field['min'] && 1 === $field['max'] );
		$as_array = apply_filters( Filter::REPEATER_AS_ARRAY, $as_array, $field );

		$field['value'] = $as_array ? $field['value'] : $field['value'][0];
	}
113255
public function type($field)
    {
        $parts = explode('.', $field);
        $table = $this->_getTable($parts);

        return $table->getSchema()->baseColumnType(array_pop($parts));
    }