@param string $item
key of the messages array (eg: 'password', 'addresses[0][line_1]')

@return array
184916
public function getMessages($item = null)
    {
        if (is_string($item)) {
            return array_key_exists($item, $this->messages) ? $this->messages[$item] : array();
        }

        return $this->messages;
    }
916126
public function clearMessages($item = null)
    {
        if (is_string($item)) {
            if (array_key_exists($item, $this->messages)) {
                unset($this->messages[$item]);
            }
        } elseif ($item === null) {
            $this->messages = array();
        }

        return $this;
    }
1321855
private function _shift(& $item) : array
    {
        $values = $this->getValues();
        if (empty($values)) {
            $item = null;
            return $values;
        }
        $item = array_shift($values);
        return $values;
    }
677814
protected function get_item_title( array $item ) {

		if ( isset( $item['taxonomy'] ) ) {
			$tax = get_taxonomy( $item['taxonomy'] );
			if ( $tax ) {
				if ( ! empty( $tax->exclusive ) ) {
					return $tax->labels->singular_name;
				} else {
					return $tax->labels->name;
				}
			} else {
				return $item['taxonomy'];
			}
		} elseif ( isset( $item['post_field'] ) ) {
			return ucwords( trim( str_replace( [
				'post_',
				'_',
			], ' ', $item['post_field'] ) ) );
		} elseif ( isset( $item['meta_key'] ) ) {
			return ucwords( trim( str_replace( [
				'_',
				'-',
			], ' ', $item['meta_key'] ) ) );
		} elseif ( isset( $item['connection'] ) && isset( $item['field'] ) && isset( $item['value'] ) ) {

			$fallback = ucwords( trim( str_replace( [
				'_',
				'-',
			], ' ', $item['value'] ) ) );

			if ( ! function_exists( 'p2p_type' ) || ! $this->p2p_connection_exists( $item['connection'] ) ) {
				return $fallback;
			}

			$ctype = p2p_type( $item['connection'] );
			if ( ! $ctype ) {
				return $fallback;
			}

			if ( isset( $ctype->fields[ $item['field'] ]['values'][ $item['value'] ] ) ) {
				if ( '' === trim( $ctype->fields[ $item['field'] ]['values'][ $item['value'] ] ) ) {
					return $ctype->fields[ $item['field'] ]['title'];
				} else {
					return $ctype->fields[ $item['field'] ]['values'][ $item['value'] ];
				}
			}

			return $fallback;

		} elseif ( isset( $item['connection'] ) ) {
			if ( function_exists( 'p2p_type' ) && $this->p2p_connection_exists( $item['connection'] ) ) {
				$ctype = p2p_type( $item['connection'] );
				if ( $ctype ) {
					$other = ( 'from' === $ctype->direction_from_types( 'post', $this->cpt->post_type ) ) ? 'to' : 'from';
					return $ctype->side[ $other ]->get_title();
				}
			}
			return $item['connection'];
		}

	}
1245615
public static function fingerprint($item)
    {
        if (is_array($item)) {
            ksort($item);
            $fingers = [];
            foreach ($item as $k => $i) {
                $fingers[$k] = static::fingerprint($i);
            }

            return md5(json_encode($fingers));
        } elseif (is_object($item)) {
            if ($item instanceof \yii\db\ActiveRecord) {
                return $item->primaryKey;
            }
        }

        return md5(json_encode($item));
    }
1242551
public function getDeleteUrlFor($item)
    {
        $params = array('id' => $item['id']);
        $params = array_merge($params, $this->getExtraParameters());

        return array(
            'path' => $this->getPathByConvention($this::SUFFIX_DELETE),
            'params' => $params,
        );
    }
200417
public static function get($item)
    {
        if (isset($_POST[$item])) {
            return $_POST[$item];
        } elseif (isset($_GET[$item])) {
            return $_GET[$item];
        } else {
            return '';
        }
    }
333253
public function parse(array $item): array
    {
        $transform = new AssetTransform();

        foreach ($item as $k => $v) {
            $transform->$k = $v;
        }

        return [$transform, null];
    }
122372
private function getFormattedItem(Item $item)
    {
        $data = [
            'type'       => $this->getFormattedName($item->getTransformer()),
            'id'         => $item->getData()->id,
            'attributes' => $item->sanitize(),
        ];

        if ($links = $item->getLinks()) {
            $data['links'] = $links;
        }

        return $data;
    }
631957
protected function getItemTotal($item)
    {
        return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
    }
140893
protected function htmlEntityEncode($item)
    {
        if (is_array($item)) {
            array_walk_recursive($item, function (&$value) {
                $value = htmlentities($value);
            });
        } else {
            $item = htmlentities($item);
        }

        return $item;
    }
1060956
private function _pop(& $item) : array
    {
        $values = $this->getValues();
        if (empty($values)) {
            $item = null;
            return $values;
        }
        $item = array_pop($values);
        return $values;
    }
1319711
protected function createField($item)
    {
        switch ($this->typeLookup[$item['type']]) {
            case 'password':
                return $this->createPasswordField($item);
                break;
            case 'datetime-local':
            case 'time':
                return $this->createInputField($item);
                break;
            case 'radio':
                return $this->createRadioField($item);
                break;
            default: // text
                return $this->createFormField($item);
        }
    }
251766
public function parse(array $item): array
    {
        unset($item['permissions'], $item['groups']);
        $item['pending'] = true;

        $user = new User($item);

        $user->username = $item['email'];

        return [$user, $user->getErrors()];
    }
1042240
public function parse(array $item): array
    {
        $item['groupId'] = $this->getGroupByName($item['group'])->id;
        unset($item['group']);
        $site = new Site($item);

        return [$site, null];
    }
1011214
protected function validate(array $item)
    {
        $object = $this->objectFactory->factor($item);
        $list = $this->validator->validate($object);

        return $list;
    }
1089663
protected function itemToArray($item)
    {
        if (is_array($item)) {
            return $item;
        } elseif (method_exists($item, 'toArray')) {
            return $item->toArray();
        } elseif (method_exists($item, 'getArrayCopy')) {
            return $item->getArrayCopy();
        }

        throw new Exception\RuntimeException(sprintf(
            'Items as part of this DataSource, with type "%s" cannot be cast to an array',
            is_object($item) ? get_class($item) : gettype($item)
        ));
    }