public function getAttribute($name)
    {
        foreach ($this->attributes as $attribute) {
            if ($attribute->getName() == $name) {
                return $attribute;
            }
        }

        return false;
    }
public function getAttribute($name)
    {
        foreach ($this->attributes as $attribute) {
            if ($attribute->getName() == $name) {
                return $attribute;
            }
        }

        return false;
    }
public function getAttribute ( $ name ) { foreach ( $ this -> attributes as $ attribute ) { if ( $ attribute -> getName ( ) == $ name ) { return $ attribute ; } } return false ; }
Get an attribute by its name

@param string $name

@return AttributeInterface|false
Get an attribute by its name