Get the field refill attributes.

@param string $field
@param ItemEntity|null $item

@return array
763511
protected function getRefillAttr($field, ItemEntity $item = null)
    {
        // item exists and can be refilled
        if ($item instanceof ItemEntity && $item->getName() &&
            ($plugins = $this->chain->getPluginsThatCanFillItem($item, $field))
        ) {
            /* @var $plugin RefillerInterface */
            foreach ($plugins as $key => $plugin) {
                $plugins[$key] = [
                    'name' => $plugin->getName(),
                    'title' => $plugin->getTitle(),
                    'can_refill' => $plugin->isCanRefill($item, $field), // can refill or can search
                ];
            }

            return [
                'data-type' => 'refill',
                'data-plugins' => $this->templating->render(
                    'AnimeDbCatalogBundle:Form:refillers.html.twig',
                    [
                        'item' => $item,
                        'field' => $field,
                        'plugins' => $plugins,
                    ]
                ),
            ];
        }

        return [];
    }
370433
public function getProperty($property, $item)
    {
        if (gettype($item) == 'array') {
            return $item[$property];
        } elseif (gettype($item) == 'object') {
            return $item->$property;
        }
        return null;
    }
967051
public function getField($field)
	{
		$result = $this->client->get("fields/{$field}");
		return $result ? new Resources\Field($this, $result) : null;
	}
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;
    }
1216184
public function getPropertyValue($entity, $field, $default = null)
    {
        $this->assertEntity($entity);

        if (is_array($entity) || $entity instanceof \ArrayAccess) {
            return isset($entity[$field]) ? $entity[$field] : $default;
        }

        $ref = $this->getReflection($entity);
        if (!$ref->hasProperty($field)) {
            return isset($entity->{$field}) ? $entity->{$field} : $default;
        }

        return $this->getProperty($ref, $field)->getValue($entity);
    }
325838
private function getScalarField($field)
	{
		$dataField = array_merge($this->defaultField, [
			'property' => $field->getName(),
			'title' => $field->getTitle(),
			'type' => get_class($field),
			'validators' => $field->getValidators(),
			'modifiers' => [
				'save' => $field->getSaveDataModifiers(),
				'fetch' => $field->getFetchDataModifiers(),
			],
		]);

		if($field instanceof Main\Entity\ScalarField){
			$dataField['primary'] = $field->isPrimary();
			$dataField['unique'] = $field->isUnique();
			$dataField['autocomplete'] = $field->isAutocomplete();
			$dataField['require'] = $field->isRequired();
			$dataField['serialized'] = $field->isSerialized();
			if(method_exists($field, 'getValues')){
				$dataField['values'] = $field->getValues();
			}
		} elseif ($field instanceof Main\Entity\ReferenceField){
			$ref = $field->getReference();
			$ref = array_shift($ref);

			preg_match('/^ref\.([a-zA-Z]+)$/i', $ref, $matchRef);

			$refEntity = $field->getRefEntity();
			$refNameShow = $matchRef[1];
			if($refEntity->hasField('NAME')){
				$refNameShow = $refEntity->getField('NAME')->getName();
			} elseif ($refEntity->hasField('TITLE')){
				$refNameShow = $refEntity->getField('TITLE')->getName();
			}
			$dataField['property'] = $field->getName().'_REF_'.$refNameShow;
			$dataField['virtual'] = true;
			$dataField['reference'] = [
				'FROM' => $field->getName(),
				'TO' => $refNameShow,
			];
		}

		return $dataField;
	}
725777
public function itemRelist($item_id, $fields)
    {
        // TODO: Tests
        $response = $this->getGuzzleClient()
            ->post(
                '/items/' . $item_id . '/relist',
                array_merge(
                    $this->setQuery(),
                    $this->setBodyArray($fields)
                )
            );

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
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
    }
1315899
protected function getInfo(ItemEntity $item)
    {
        $filename = self::INFO_FILENAME.'.html';
        if (is_file($item->getPath())) {
            return dirname($item->getPath()).pathinfo($item->getPath(), PATHINFO_FILENAME).'-'.$filename;
        } else {
            return $item->getPath().'/'.$filename;
        }
    }
622877
public function get_plugin_info( $field = null ) {
		$info = get_plugin_data( $this->plugin_file );
		if ( null !== $field && isset( $info[ $field ] ) ) {
			return $info[ $field ];
		}

		return $info;
	}
194016
public function getOne($field = null)
    {
        $row = $this->statement->fetch(PDO::FETCH_ASSOC);

        return null === $field ? $row : $row[$field];
    }
520678
private function parseArrayToFieldEntity(array $item, $elementType)
    {
        $entity = new Field();
        $entity->set($item);
        $entity->element_type = $elementType;

        return $entity;
    }
6834
public function refill(Item $item, $field)
    {
        if (!($url = $this->getSourceForFill($item))) {
            return $item;
        }

        // get data
        preg_match(Filler::REG_ITEM_ID, $url, $match);
        $path = str_replace('#ID#', $match['id'], Filler::FILL_URL);
        $body = $this->browser->get($path);

        switch ($field) {
            case self::FIELD_DATE_END:
                if ($body['released_on']) {
                    $item->setDateEnd(new \DateTime($body['released_on']));
                }
                break;
            case self::FIELD_DATE_PREMIERE:
                $item->setDatePremiere(new \DateTime($body['aired_on']));
                break;
            case self::FIELD_DURATION:
                $item->setDuration($body['duration']);
                break;
            case self::FIELD_EPISODES_NUMBER:
                $ep_num = $body['episodes_aired'] ? $body['episodes_aired'] : $body['episodes'];
                $item->setEpisodesNumber($ep_num.($body['ongoing'] ? '+' : ''));
                break;
            case self::FIELD_GENRES:
                $new_item = $this->filler->setGenres(new Item(), $body);
                foreach ($new_item->getGenres() as $new_genre) {
                    $item->addGenre($new_genre);
                }
                break;
            case self::FIELD_IMAGES:
                $this->filler->setImages($item, $body);
                break;
            case self::FIELD_NAMES:
                $new_item = $this->filler->setNames(new Item(), $body);
                // set main name in top of names list
                $names = $new_item->getNames()->toArray();
                array_unshift($names, (new Name())->setName($new_item->getName()));
                foreach ($names as $new_name) {
                    $item->addName($new_name);
                }
                break;
            case self::FIELD_SOURCES:
                $new_item = $this->filler->setSources(new Item(), $body);
                foreach ($new_item->getSources() as $new_source) {
                    $item->addSource($new_source);
                }
                break;
            case self::FIELD_STUDIO:
                $this->filler->setStudio($item, $body);
                break;
            case self::FIELD_SUMMARY:
                $item->setSummary($body['description']);
                break;
        }

        return $item;
    }
812167
public function fields( $field = null, $option = null ) {

		$field_data = null;

		if ( empty( $this->fields ) ) {
			// No fields found.
			$field_data = array();
		} elseif ( empty( $field ) ) {
			// Return all fields.
			$field_data = (array) $this->fields;
		} elseif ( ! isset( $this->fields[ $field ] ) && ! isset( $this->pod_data['object_fields'][ $field ] ) ) {
			// Field not found.
			$field_data = array();
		} elseif ( empty( $option ) ) {
			// Return all field data.
			if ( isset( $this->fields[ $field ] ) ) {
				$field_data = $this->fields[ $field ];
			} elseif ( isset( $this->pod_data['object_fields'] ) ) {
				$field_data = $this->pod_data['object_fields'][ $field ];
			}
		} else {
			$options = array();

			// Merge options.
			if ( isset( $this->fields[ $field ] ) ) {
				$options = array_merge( $this->fields[ $field ], $this->fields[ $field ]['options'] );
			} elseif ( isset( $this->pod_data['object_fields'] ) ) {
				$options = array_merge( $this->pod_data['object_fields'][ $field ], $this->pod_data['object_fields'][ $field ]['options'] );
			}

			if ( 'data' === $option && in_array( pods_v( 'type', $options ), PodsForm::tableless_field_types(), true ) ) {
				// Get a list of available items from a relationship field.
				$field_data = PodsForm::field_method( 'pick', 'get_field_data', $options );
			} elseif ( isset( $options[ $option ] ) ) {
				// Return option.
				$field_data = $options[ $option ];
			}
		}//end if

		/**
		 * Modify the field data before returning
		 *
		 * @since unknown
		 *
		 * @param array       $field_data The data for the field.
		 * @param string|null $field      The specific field that data is being return for, if set when method is called or null.
		 * @param string|null $option     Value of option param when method was called. Can be used to get a list of available items from a relationship field.
		 * @param Pods|object $this       The current Pods class instance.
		 */
		return apply_filters( 'pods_pods_fields', $field_data, $field, $option, $this );

	}
68440
public function transform_item_values_to_json( $item ) {
		foreach ( $this->args['fields'] as $field ) {
			$true_field = $this->find_item_key( $item, $field );
			$value      = is_object( $item ) ? $item->$true_field : $item[ $true_field ];
			if ( is_array( $value ) || is_object( $value ) ) {
				if ( is_object( $item ) ) {
					$item->$true_field = json_encode( $value );
				} elseif ( is_array( $item ) ) {
					$item[ $true_field ] = json_encode( $value );
				}
			}
		}
		return $item;
	}
184916
public function getMessages($item = null)
    {
        if (is_string($item)) {
            return array_key_exists($item, $this->messages) ? $this->messages[$item] : array();
        }

        return $this->messages;
    }
473606
public function getField($field)
    {
        $result = array_filter($this->getFields(), function($input) use ($field) {
            return $field === $input->getName();
        });

        return reset($result);
    }