Get media of a specific field.

@param  $field
@return object|null
431399
public function mediaField($field)
    {
        if(count($this->media)) {
            $results = $this->media->where('field', $field);
            if(count($results)) {
                return $results;
            }
        }

        return null;
    }
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'] );
				}
			}
		}
	}
199686
public function getFieldObjectByName($field, $type)
    {
        $info = false;

        //we want to get the correct options depending on the type of field it is
        if ($type === 'filter') {
            $fields = $this->getFilters();
        } else {
            $fields = $this->getEditFields();
        }

        //iterate over the fields to get the one for this $field value
        foreach ($fields as $key => $val) {
            if ($key === $field) {
                $info = $val;
            }
        }

        return $info;
    }
46846
protected function get_field($field) {
        $fieldname = calculator::using_attempts_string_id($this->whichattempts).$field;
        return $this->{$fieldname};
    }
189617
protected static function filter($field)
    {
        $field = preg_replace('/[\.\/\\:;,?$*!#_-]/', '', $field);
        $field = preg_replace('/\s+/', ' ', trim($field));
        return $field;
    }
673703
public function getFieldType($object, $field)
	{
		$metadata  = $this->manager->getClassMetadata(get_class($object));

		if ($metadata->hasField($field)) {
			return $metadata->getTypeOfField($field);
		} else if ($metadata->hasAssociation($field) && $metadata->isSingleValuedAssociation($field)) {
			return self::ASSOCIATION_TO_ONE;
		} else if ($metadata->hasAssociation($field) && $metadata->isCollectionValuedAssociation($field)) {
			return self::ASSOCIATION_TO_MANY;
		}

		return null;
	}
279744
public function dbObject($field)
    {
        $fields = $this->compositeDatabaseFields();
        if (!isset($fields[$field])) {
            return null;
        }

        // Build nested field
        $key = $this->getName() . $field;
        $spec = $fields[$field];
        /** @var DBField $fieldObject */
        $fieldObject = Injector::inst()->create($spec, $key);
        $fieldObject->setValue($this->getField($field), null, false);
        return $fieldObject;
    }
870222
public function imageUrl($field = null)
    {
        $this->uploadFieldName = $this->getUploadFieldName($field);
        $this->uploadFieldOptions = $this->getUploadFieldOptions($this->uploadFieldName);

        // get the model attribute value
        $attributeValue = $this->getOriginal($this->uploadFieldName);

        // check for placeholder defined in option
        $placeholderImage = array_get($this->uploadFieldOptions, 'placeholder');

        return (empty($attributeValue) && $placeholderImage)
            ? $placeholderImage
            : $this->getStorageDisk()->url($attributeValue);
    }
472686
final public function getRowFieldValue($field)
    {

        //If value exists;
        if (array_key_exists($field, $this->schema)) {
            return $this->schema[$field]->Value;
        }
        return null;
    }
1141550
protected function getItem($field)
    {
        $property = $field['field'];

        // If the field is an array,
        // make it an array in the Migration
        if (is_array($property)) {
            $property = "['". implode("','", $property) ."']";
        } else {
            $property = $property ? "'$property'" : null;
        }

        $type = $field['type'];

        $output = sprintf(
            "\$table->%s(%s)",
            $type,
            $property
        );

        // If we have args, then it needs
        // to be formatted a bit differently
        if (isset($field['args'])) {
            $output = sprintf(
                "\$table->%s(%s, %s)",
                $type,
                $property,
                $field['args']
            );
        }
        if (isset($field['decorators'])) {
            $output .= $this->addDecorators($field['decorators']);
        }
        return $output . ';';
    }
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
    }
841844
protected function getLoaderData($field)
    {
        $loaderName = $this->loadersMap->getLoaderForField($field);
        if (!isset($this->loadersResults[ $loaderName ])) {
            $this->loadersResults[ $loaderName ] = $this->{sprintf('%sLoader', $loaderName)}();
        }

        return $this->loadersResults[ $loaderName ];
    }
562226
protected function getField($field)
    {
        if ($this->isFieldSupported($field) && isset($this->fields[ $field ])) {
            return $this->fields[ $field ];
        }

        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
  }
1159408
public function getCustomField($type, $field)
    {
        if (!isset($this->customFields[$type]) ||
             !isset($this->customFields[$type][$field])) {
            return null;
        }

        return $this->customFields[$type][$field];
    }
684982
public function getField(string $field)
    {
        if (isset($this->_record[$field]))
            return $this->_record[$field];
        return null;
    }
1068834
public function getUploadFieldName($field = null)
    {
        if (!is_null($field)) {
            return $field;
        }

        $imagesFields = $this->getDefinedUploadFields();
        $fieldKey = array_first(array_keys($imagesFields));

        // return first field name
        return is_int($fieldKey)
            ? $imagesFields[$fieldKey]
            : $fieldKey;
    }