public function getAttribute($key = null)
    {
        if ($this->attributes === null) {
            $this->parseAttributes();
        }

        if (is_null($key)) {
            return $this->attributes;
        }

        if (!array_key_exists($key, $this->attributes)) {
            return null;
        }

        return $this->attributes[$key];
    }
public function getAttribute($key = null)
    {
        if ($this->attributes === null) {
            $this->parseAttributes();
        }

        if (is_null($key)) {
            return $this->attributes;
        }

        if (!array_key_exists($key, $this->attributes)) {
            return null;
        }

        return $this->attributes[$key];
    }
public function getAttribute ( $ key = null ) { if ( $ this -> attributes === null ) { $ this -> parseAttributes ( ) ; } if ( is_null ( $ key ) ) { return $ this -> attributes ; } if ( ! array_key_exists ( $ key , $ this -> attributes ) ) { return null ; } return $ this -> attributes [ $ key ] ; }
Get one or all attributes for the content

@param string|null $key
@return array|mixed|null
Get one or all attributes for the content