Converts attributes to specific dataobjects if configured to

@param string $key
@return mixed|DataObjectInterface
337403
public function &getAttributeValue(string $key)
    {
        if (    ! count($this->objects)
            ||  ! array_key_exists($key, $this->objects)
        ) {
            return parent::getAttributeValue($key);
        }

        if ( ! isset($this->attributes[$key])) {
            $null = null;
            return $null;
        }

        $dataObjectClass = $this->objects[$key];
        $dataObjectArray = false;

        if (substr($dataObjectClass, -2) === '[]') {
            $dataObjectClass = substr($dataObjectClass, 0, -2);
            $dataObjectArray = true;
        }

        if ($dataObjectArray) {

            if (is_array($this->attributes[$key])) {

                foreach ($this->attributes[$key] as $index => &$item) {

                    if (null === $item) {
                        continue;
                    }

                    if ( ! is_a($item, $dataObjectClass)) {

                        $item = $this->makeNestedDataObject($dataObjectClass, $item, $key . '.' . $index);
                    }
                }
            }

            unset($item);

        } else {

            if ( ! is_a($this->attributes[ $key ], $dataObjectClass)) {

                $this->attributes[ $key ] = $this->makeNestedDataObject($dataObjectClass, $this->attributes[ $key ], $key);
            }
        }

        return $this->attributes[$key];
    }
663301
public function getAttribute( $key ){
		if( !array_key_exists( $key, $this->attributes ) )
			return NULL;
		return $this->attributes[$key];
	}
330517
public function extractKey($key)
    {
        $self       = clone($this);
        $self->data = Accessor::get($this->data, $key) ?: [];
        return $self;
    }
1314842
public function getAttribute(string $key)
    {
        $inAttributes = array_key_exists($key, $this->attributes);

        if ($inAttributes) {
            return $this->attributes[$key];
        } elseif ('attributes' == $key) {
            return $this->attributes;
        }
    }
1166840
public function attribute(string $key)
    {
        if (! isset($this->attributes[$key])) {
            return '';
        }

        return $this->attributes[$key];
    }
260450
public function getAttribute($key)
    {
        return isset($this->options['attributes'][$key])
        ? $this->options['attributes'][$key]
        : false;
    }
1164031
public function map(string $key, array $data): array
    {
        $fields = $this->map[$key] ?? null;
        if (empty($fields) || empty($data)) {
            return $data;
        }

        foreach ($fields as $fieldName => $fieldProperties) {
            foreach ($data as &$dat) {
                foreach ($dat as $name => $value) {
                    if ($name == $fieldName) { // match field?
                        if (is_array($dat)) {
                            $dat[$name] = $this->cast($value, $fieldProperties);
                        } elseif (is_object($dat)) {
                            $dat->{$name} = $this->cast($value, $fieldProperties);
                        }
                    }
                }
            }
        }

        return $data;
    }
511729
protected function getAttributeFromArray($key)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }

        return null;
    }
894881
protected function fromBody(string $key)
    {
        $dataCollection = $this->parseBody();

        if (!$this->inBody([$key])) {
            throw new \InvalidArgumentException('Data with key ' . $key . ' doesn\'t exist in request body.');
        }

        return $dataCollection[$key];
    }
1347856
public function getObjects($key = null, $default = null)
    {
        $objData = $this->getObjData();

        return Util::getValueByKey($objData, $key, $default);
    }
38236
protected function getEntityAttributeValue(string $key)
    {
        $value = $this->getEntityAttributeRelation($key);

        // In case we are accessing to a multivalued attribute, we will return
        // a collection with pairs of id and value content. Otherwise we'll
        // just return the single model value content as a plain result.
        if ($this->getEntityAttributes()->get($key)->is_collection) {
            return $value->pluck('content');
        }

        return ! is_null($value) ? $value->getAttribute('content') : null;
    }
211511
public function getAttributes($key = null) {
		if (!empty($this->_stub['iframe-player']) && $this->config['prefer'] === 'iframe') {
			if ($key === null) {
				return $this->_iframeAttributes;
			}
			if (!isset($this->_iframeAttributes[$key])) {
				return null;
			}
			return $this->_iframeAttributes[$key];
		}

		if ($key === null) {
			return $this->_objectAttributes;
		}
		if (!isset($this->_objectAttributes[$key])) {
			return null;
		}
		return $this->_objectAttributes[$key];
	}
278611
protected function loadRef($key)
    {
        $attrs = $this->getAttrs();
        $reference = $attrs[$key];
        $cache = &$this->_cache;
        if (isset($this->cleanData[$key])) {
            $value = $this->cleanData[$key];
        } else {
            $value = null;
        }

        $model = $reference['model'];
        $type = $reference['type'];
        if ( isset($cache[$key]) ) {
            $obj = &$cache[$key];

            return $obj;
        } else {
            if (class_exists($model)) {
                if ($type == self::DATA_TYPE_REFERENCE) {
                    if (\MongoDBRef::isRef($value)) {
                        $object = $model::id($value['$id']);
                        $cache[$key] = $object;

                        return $object;
                    }

                    return null;
                } elseif ($type == self::DATA_TYPE_REFERENCES) {
                    $res = array();
                    if (!empty($value)) {
                        foreach ($value as $item) {
                            if(isset($item['$id'], $item['$ref'])) {
                                $record = $model::id($item['$id']);
                                if ($record) {
                                    $res[] = $record;
                                }
                            }
                        }
                    }
                    $set =  Collection::make($res);
                    $cache[$key] = $set;
                    $obj = &$cache[$key];

                    return $obj;
                }
            }
        }
    }
980013
public function getAttributeValue($key)
    {
        $value = $this->getAttributeFromArray($key);

        // Verificar se tem mutator
        if ($this->hasGetMutator($key)) {
            $method = sprintf($this->methodNameGetMutator, Str::studly($key));

            return call_user_func_array([$this, $method], [$value]);
        }

        // If the attribute exists within the cast array, we will convert it to
        // an appropriate native PHP type dependant upon the associated value
        // given with the key in the pair. Dayle made this comment line up.
        //if ($this->hasCast($key)) {
        //    return $this->castAttribute($key, $value);
        //}

        // If the attribute is listed as a date, we will convert it to a DateTime
        // instance on retrieval, which makes it quite convenient to work with
        // date fields without having to create a mutator for each property.
        //if (in_array($key, $this->getDates()) && ! is_null($value)) {
        //    return $this->asDateTime($value);
        //}

        return $value;
    }
1135851
public function getOriginal($key)
    {
        $key = $this->reFormatForCompatibility($key);

        return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null;
    }
1328887
public function get($key)
    {
        $data = $this->connection()->get($this->prefix.$key);

        if (!is_null($data)) {
            return (is_numeric($data)) ? $data : unserialize($data);
        }
    }
244988
protected function getRaw($key)
	{
		if (isset($this->dataStore[$key]))
		{
			return $this->dataStore[$key];
		}

		$aliasKey = $this->resolveAlias($key);

		if ($aliasKey !== $key && isset($this->dataStore[$aliasKey]))
		{
			return $this->dataStore[$aliasKey];
		}

		if ($this->parent instanceof Container)
		{
			return $this->parent->getRaw($key);
		}

		if ($this->parent instanceof ContainerInterface && $this->parent->has($key))
		{
			$callback = $this->parent->get($key);

			if (!\is_callable($callback))
			{
				$callback = function () use ($callback)
				{
					return $callback;
				};
			}

			return array(
				'callback'  => $callback,
				'shared'    => true,
				'protected' => true,
			);
		}
	}