@param Field $field

@return mixed|null|string

@throws NotImplemented

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
512673
public function effectiveDefault($field)
    {
        if ($field->hasDefault()) {
            $default = $field->getDefault();
        } elseif (($field->hasProperty('autoNow') && $field->autoNow) ||
            ($field->hasProperty('addAutoNow') && $field->addAutoNow)
        ) {
            $default = new \DateTime('now', BaseOrm::getInstance()->getTimezone());
        } else {
            $default = null;
        }
        if (is_callable($default)) {
            $default = call_user_func($default);
        }

        return $default;
    }
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;
    }
21080
private function getPhpDataType(Field $field): string
    {
        $dataType = static::TYPE_MAP[$field->getDataType()];
        if ('Single' != $field->getDataStructure()) {
            $dataType .= '[]';
        }

        return $dataType;
    }
1140465
public function getFieldData($field)
    {
        // $this->data could only be array or object, which has been checked by $this->setData
        if ((is_array($this->data) && array_key_exists($field, $this->data))
            || ($this->data instanceof \ArrayAccess && $this->data->offsetExists($field))
        ) {
            return $this->data[$field];
        } elseif (isset($this->data->$field)) {
            return $this->data->$field;
        } elseif (method_exists($this->data, 'get' . $field)) {
            return $this->data->{'get' . $field}();
        } else {
            return null;
        }
    }
1343780
public function get($field) {
    // wir machen hier erstmal nicht so performant immer einen meta-check
    $this->meta->getFieldType($field); // throws FieldNotDefinedException
      
    return $this->fields->get($field, NULL, NULL); // returned immer NULL wenn nicht gesetzt
  }
1343815
public function original($field = null)
    {
        if (!$field) {
            return $this->_original;
        }
        return isset($this->_original[$field]) ? $this->_original[$field] : null;
    }
850880
public function getHeader($field)
    {
       if (!isset($this->headers[$field])) {
           return null;
       }
       
       return is_array($this->headers[$field]) ? implode(',', $this->headers[$field]) : $this->headers[$field];
    }
1093917
protected function _schemaDefault($field)
    {
        $field = $this->_form->schema()->field($field);
        if ($field) {
            return $field['default'];
        }

        return null;
    }
702033
public function getNotEmptyMessage($field)
    {
        if (!isset($this->_fields[$field])) {
            return null;
        }

        $defaultMessage = 'This field cannot be left empty';
        if ($this->_useI18n) {
            $defaultMessage = __d('cake', 'This field cannot be left empty');
        }

        $notBlankMessage = null;
        foreach ($this->_fields[$field] as $rule) {
            if ($rule->get('rule') === 'notBlank' && $rule->get('message')) {
                return $rule->get('message');
            }
        }

        return isset($this->_allowEmptyMessages[$field])
            ? $this->_allowEmptyMessages[$field]
            : $defaultMessage;
    }
59199
function getFieldValue( $field )
    {
        if ( isset( $this->callbackData[$field] ) )
        {
            return $this->callbackData[ $field ];
        }

        $this->logger->writeTimedString( "field $field does not exist.", 'getFieldValue failed' );
        return null;
    }
620711
public function getNewValue(string $field)
    {
        $change = $this->objectChangeSet->getFieldChange($field);

        if ($change !== null) {
            return $change->getNewValue();
        }
    }
713282
public function isNotNull($field)
    {
        return new Expr\ComparisonExpression($field, new Expr\ValueIdentifier(null), Expr\ComparisonExpression::NEQ);
    }
241436
public function getField($field)
    {
        return $this->getFields()->filter(function($input) use ($field) {
            return $field === $input->getName();
        })->first();
    }
189617
protected static function filter($field)
    {
        $field = preg_replace('/[\.\/\\:;,?$*!#_-]/', '', $field);
        $field = preg_replace('/\s+/', ' ', trim($field));
        return $field;
    }
819093
protected function getFieldItem(Field $field)
    {
        if ($field->hasForeignRelation()) {
            $relation = $field->getForeignRelation();

            return sprintf('$%s', $relation->getSingleName());
        }

        return '$text';
    }
1124936
public function addFieldCache($field)
    {
        if ( !$cache = $this->getMongator()->getFieldsCache() ) {
            return null;
        }

        $field = preg_replace('/\.\d+/', '', $field);

        foreach ($this->getQueryHashes() as $hash) {
            $value = $cache->get($hash);
            if (!$value) $value = array();

            if ( !isset($value['fields'][$field]) || $value['fields'][$field] != 1 ) {
                $value['fields'][$field] = 1;
                $cache->set($hash, $value);
            }
        }
    }
394272
public function getFieldType($field) {
    try {
      $key = $this->getKey($field);
      
      // dies kann auch einen verschachtelten Array von Types zurück geben, wenn der Schlüssel den man angibt noch Untertypen hat
      return $this->types->get($key, DataInput::THROW_EXCEPTION, DataInput::THROW_EXCEPTION);
    
    } catch (\Psc\DataInputException $e) {
      $e = new FieldNotDefinedException(sprintf("Feld mit den Schluessel(n) '%s' ist nicht in Meta definiert. Vorhanden sind (Ebenen durch . getrennt): %s",
                                                $key, implode(', ', $avFields = $this->getKeys())),
                                        0, $e);
      $e->field = explode(':',$key); // expand
      $e->avaibleFields = $avFields;
      throw $e;
    }
  }