Get an attribute from the $attributes array.

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

        return null;
    }
1060275
public function getAttribute($key)
    {
        if ($this->isKeyReturningTranslationText($key)) {
            if ($translation = $this->getTranslation()) {
                return $translation->$key;
            }

            # fallback: try to find default locale values
            if ($translation = $this->getTranslation(\localizer\getDefault()->id())) {
                return $translation->$key;
            }

            return null;
        }

        return parent::getAttribute($key);
    }
1270044
public function getAttribute($key)
    {
        if (! $this->isValueObject($key)) {
            return parent::getAttribute($key);
        }

        if (! $this->isValueObjectCached($key)) {

            // Allow other mutators and such to do their work first.
            $value = parent::getAttribute($key);

            // Don't cast empty $value.
            if ($value === null || $value === '') {
                return null;
            }

            // Cache the instantiated value for future access.
            // This allows tests such as ($model->casted === $model->casted) to be true.
            $this->cacheValueObject($key, $this->createValueObject($key, $value));
        }

        return $this->getCachedValueObject($key);
    }
40132
public function get($key, $default = NULL)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }

        return $default;
    }
581592
public function getAttributeValue($key)
    {
        $value = $this->getAttributeFromArray($key);
        // check if it's a enum
        if (isset($this->enums[$key]) && is_scalar($value)) {
            $enumClass = $this->enums[$key];
            return new $enumClass($value);
        }
        return parent::getAttributeValue($key);
    }
1242790
public function getAttribute($key)
	{
		$inAttributes = array_key_exists($key, $this->attributes);

		// If the key references an attribute, we can just go ahead and return the
		// plain attribute value from the model. This allows every attribute to
		// be dynamically accessed through the _get method without accessors.
		if ($inAttributes || $this->hasGetMutator($key))
		{
			return $this->getAttributeValue($key);
		}

		// If the key already exists in the relationships array, it just means the
		// relationship has already been loaded, so we'll just return it out of
		// here because there is no need to query within the relations twice.
		if (array_key_exists($key, $this->relations))
		{
			return $this->relations[$key];
		}

		// If the "attribute" exists as a method on the model, we will just assume
		// it is a relationship and will load and return results from the query
		// and hydrate the relationship's value on the "relationships" array.
		if (method_exists($this, $key))
		{
			return $this->getRelationshipFromMethod($key);
		}
	}
493523
public function get($key)
	{
		$key = $this->normalizeKey($key);

		if (!$this->exists($key))
		{
			if ($key[0] === '#')
			{
				$this->set($key, self::getDefaultFilter(substr($key, 1)));
			}
			else
			{
				$this->set($key, new AttributeFilter($key));
			}
		}

		// Get the filter from the collection
		$filter = parent::get($key);

		// Clone it to preserve the original instance
		$filter = clone $filter;

		return $filter;
	}
500045
public Object getAttribute(String key) {
		Object result;
		if (attributes == null) {
			result = null;
		} else {
			result = attributes.get(key);
		}
		return result;
	}
1263593
public function getAttr($key = null)
    {
        if (null !== $key) {
            return isset($this->attr[$attribute]) ? $this->attr[$attribute] : null;
        }

        return $this->attr;
    }
1239613
protected function getAttribute($key)
    {
        if (true === $this->isCalculatedAttribute($key)) {
            return $this->getCalculatedAttribute($key);
        }
        $this->touch();
        return $this->attributes->get($key);
    }
1308304
public function get($key, $default = null)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }

        return $default;
    }
473366
public function getAttribute($key)
    {
        // Sanitize the key
        $key = preg_replace('/^_/', '', $key);

        // Decoder ring for legacy keys
        switch ($key) {
            case 'size':
                $key = 'file_size';
                break;
            case 'filename':
            case 'original_filename':
                $key = 'file_name';
                break;
        }

        return $this->getInstance()
            ->getAttribute("{$this->name}_{$key}");
    }
1026651
public function getAttributeValue($key)
    {
        $value = $this->getAttributeFromArray($key);

        // If the attribute has a get mutator, we will call that then return what
        // it returns as the value, which is useful for transforming values on
        // retrieval from the model to a form that is more useful for usage.
        if ($this->hasGetMutator($key)) {
            return $this->mutateAttribute($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.
        elseif (in_array($key, $this->dates)) {
            if (! is_null($value)) {
                return $this->asDateTime($value);
            }
        }

        return $value;
    }
117320
protected function getAttributeValue($key)
	{
		$value = parent::getAttributeValue($key);

		if ($this->isCastableAttribute($key))
		{
			$value = $this->castAttribute($key, $value);
		}

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

        return (property_exists($this, $key)) ? $this->{$key} : null;
    }
1005702
public Object getAttribute(String key) {
        if (attributes != null && !attributes.isEmpty()) {
            return attributes.get(key);
        }
        return null;
    }
648105
public function getAttribute($key)
    {
        if (array_key_exists($key, $this->attributes))
        {
            $value = $this->attributes[$key];

            if (in_array($key, $this->getDates()))
            {
                return $this->asDateTime($value);
            }

            return $value;
        }
    }