public function get_attribute( $key ) {
		if ( 'id' === $key ) {
			return $this->get_id();
		}

		// Return a "null" if not found attribute.
		if ( ! array_key_exists( $key, $this->attributes ) ) {
			return;
		}

		// The value should be returned.
		$value = $this->attributes[ $key ];

		// Cast to native PHP type and return if has case.
		if ( $this->has_cast( $key ) ) {
			return $this->cast_attribute( $key, $value );
		}

		return $value;
	}
public function get_attribute( $key ) {
		if ( 'id' === $key ) {
			return $this->get_id();
		}

		// Return a "null" if not found attribute.
		if ( ! array_key_exists( $key, $this->attributes ) ) {
			return;
		}

		// The value should be returned.
		$value = $this->attributes[ $key ];

		// Cast to native PHP type and return if has case.
		if ( $this->has_cast( $key ) ) {
			return $this->cast_attribute( $key, $value );
		}

		return $value;
	}
public function get_attribute ( $ key ) { if ( 'id' === $ key ) { return $ this -> get_id ( ) ; } // Return a "null" if not found attribute. if ( ! array_key_exists ( $ key , $ this -> attributes ) ) { return ; } // The value should be returned. $ value = $ this -> attributes [ $ key ] ; // Cast to native PHP type and return if has case. if ( $ this -> has_cast ( $ key ) ) { return $ this -> cast_attribute ( $ key , $ value ) ; } return $ value ; }
Get an attribute from this object.

@param  string $key Attribute key name.
@return mixed|null
Get an attribute from this object .