src/Axolotl/Model.php
public function set_attribute( $name, $value ) {
		if ( self::OBJECT_KEY === $name ) {
			return $this->override_wp_object( $value );
		}

		if ( self::TABLE_KEY === $name ) {
			return $this->override_table( $value );
		}

		if ( ! $this->is_fillable( $name ) ) {
			throw new GuardedPropertyException;
		}

		if ( $method = $this->has_map_method( $name ) ) {
			$this->attributes[ self::OBJECT_KEY ]->{$this->{$method}()} = $value;
		} else {
			$this->attributes[ self::TABLE_KEY ][ $name ] = $value;
		}

		return $this;
	}
public function set_attribute( $name, $value ) {
		if ( self::OBJECT_KEY === $name ) {
			return $this->override_wp_object( $value );
		}

		if ( self::TABLE_KEY === $name ) {
			return $this->override_table( $value );
		}

		if ( ! $this->is_fillable( $name ) ) {
			throw new GuardedPropertyException;
		}

		if ( $method = $this->has_map_method( $name ) ) {
			$this->attributes[ self::OBJECT_KEY ]->{$this->{$method}()} = $value;
		} else {
			$this->attributes[ self::TABLE_KEY ][ $name ] = $value;
		}

		return $this;
	}
public function set_attribute ( $ name , $ value ) { if ( self :: OBJECT_KEY === $ name ) { return $ this -> override_wp_object ( $ value ) ; } if ( self :: TABLE_KEY === $ name ) { return $ this -> override_table ( $ value ) ; } if ( ! $ this -> is_fillable ( $ name ) ) { throw new GuardedPropertyException ; } if ( $ method = $ this -> has_map_method ( $ name ) ) { $ this -> attributes [ self :: OBJECT_KEY ] -> { $ this -> { $ method } ( ) } = $ value ; } else { $ this -> attributes [ self :: TABLE_KEY ] [ $ name ] = $ value ; } return $ this ; }
Sets the model attributes.

Checks whether the model attribute can be set, check if it
maps to the WP_Post property, otherwise, assigns it to the
table attribute array.

@param string $name
@param mixed  $value

@return $this

@throws GuardedPropertyException
Sets the model attributes .