PHP Class Inpsyde\MultilingualPress\Relations\Post\RelationshipContext

Since: 3.0.0
Show file Open project: inpsyde/multilingual-press Class Usage Examples

Public Methods

Method Description
__construct ( array $data = [] ) Constructor. Sets up the properties.
from_existing ( RelationshipContext $context, array $data ) : RelationshipContext Returns a new context object, instantiated according to the data in the given context object and the array.
from_request ( ) : static Returns a new context object, instantiated according to the data in the current request.
new_post_id ( ) : integer Returns the new post ID.
new_post_title ( ) : string Returns the new post title.
remote_post_id ( ) : integer Returns the remote post ID.
remote_site_id ( ) : integer Returns the remote site ID.
source_post ( ) : WP_Pos\WP_Post | null Returns the source post object.
source_post_id ( ) : integer Returns the source post ID.
source_site_id ( ) : integer Returns the source site ID.

Method Details

__construct() public method

Constructor. Sets up the properties.
Since: 3.0.0
public __construct ( array $data = [] )
$data array Optional. Initial context data. Defaults to empty array.

from_existing() public static method

Returns a new context object, instantiated according to the data in the given context object and the array.
Since: 3.0.0
public static from_existing ( RelationshipContext $context, array $data ) : RelationshipContext
$context RelationshipContext Context object.
$data array Context data.
return RelationshipContext Context object.

from_request() public static method

Returns a new context object, instantiated according to the data in the current request.
Since: 3.0.0
public static from_request ( ) : static
return static Context object.

new_post_id() public method

Returns the new post ID.
Since: 3.0.0
public new_post_id ( ) : integer
return integer New post ID.

new_post_title() public method

Returns the new post title.
Since: 3.0.0
public new_post_title ( ) : string
return string New post title.

remote_post_id() public method

Returns the remote post ID.
Since: 3.0.0
public remote_post_id ( ) : integer
return integer Remote post ID.

remote_site_id() public method

Returns the remote site ID.
Since: 3.0.0
public remote_site_id ( ) : integer
return integer Remote site ID.

source_post() public method

Returns the source post object.
Since: 3.0.0
public source_post ( ) : WP_Pos\WP_Post | null
return WP_Pos\WP_Post | null Source post object.

source_post_id() public method

Returns the source post ID.
Since: 3.0.0
public source_post_id ( ) : integer
return integer Source post ID.

source_site_id() public method

Returns the source site ID.
Since: 3.0.0
public source_site_id ( ) : integer
return integer Source site ID.