ReservedRoomPersistence extends CPTPersistence
in package

Table of Contents

$postType  : mixed
__construct()  : mixed
_customizeGetPostsDistinct()  : string
_customizeGetPostsJoin()  : string
_customizeGetPostsWhere()  : mixed
convertToIdTitleList()  : array<string|int, mixed>
create()  : int
Insert Post to DB
createOrUpdate()  : int
delete()  : int
getCount()  : int
getIdTitleList()  : mixed
getPost()  : mixed
getPosts()  : array<string|int, WP_Post>|array<string|int, int>
update()  : int
addGetPostsFilters()  : mixed
getDefaultQueryAtts()  : array<string|int, mixed>
modifyQueryAtts()  : array<string|int, mixed>
removeGetPostsFilters()  : mixed
updatePostRelatedData()  : mixed
_addBookingCriteria()  : mixed
_addRoomCriteria()  : mixed

Properties

$postType

protected mixed $postType

Methods

__construct()

public __construct(mixed $postType) : mixed
Parameters
$postType : mixed
Return values
mixed

_customizeGetPostsDistinct()

public _customizeGetPostsDistinct(string $distinct, WP_Query $wp_query) : string
Parameters
$distinct : string
$wp_query : WP_Query
Return values
string

_customizeGetPostsJoin()

public _customizeGetPostsJoin(mixed $join, WP_Query $wp_query) : string
Parameters
$join : mixed
$wp_query : WP_Query
Return values
string

_customizeGetPostsWhere()

public _customizeGetPostsWhere(string $where, WP_Query $wp_query) : mixed
Parameters
$where : string
$wp_query : WP_Query
Return values
mixed

convertToIdTitleList()

public convertToIdTitleList(array<string|int, int>|array<string|int, WP_Post$posts) : array<string|int, mixed>
Parameters
$posts : array<string|int, int>|array<string|int, WP_Post>

Array of post ids or posts

Return values
array<string|int, mixed>

Array id => title

create()

Insert Post to DB

public create(WPPostData $postData) : int
Parameters
$postData : WPPostData
Tags
since
3.7.0

added new filter - "{postType}_persistence_new_post_data".

Return values
int

The post ID on success. The value 0 on failure.

createOrUpdate()

public createOrUpdate(WPPostData $postData) : int
Parameters
$postData : WPPostData
Return values
int

delete()

public delete(WPPostData $postData) : int
Parameters
$postData : WPPostData
Tags
since
3.7.0

added new action - "{postType}_persistence_before_delete_post".

Return values
int

Id of returned post. 0 on failure.

getCount()

public getCount([array<string|int, mixed> $atts = array() ]) : int
Parameters
$atts : array<string|int, mixed> = array()
Return values
int

getIdTitleList()

public getIdTitleList([mixed $atts = array() ][, mixed $extend = array() ]) : mixed
Parameters
$atts : mixed = array()
$extend : mixed = array()
Return values
mixed

getPost()

public getPost(mixed $id) : mixed
Parameters
$id : mixed
Return values
mixed

getPosts()

public getPosts([array<string|int, mixed> $atts = array() ]) : array<string|int, WP_Post>|array<string|int, int>
Parameters
$atts : array<string|int, mixed> = array()

Optional.

Return values
array<string|int, WP_Post>|array<string|int, int>

List of posts.

update()

public update(WPPostData $postData) : int
Parameters
$postData : WPPostData
Return values
int

addGetPostsFilters()

protected addGetPostsFilters() : mixed
Return values
mixed

getDefaultQueryAtts()

protected getDefaultQueryAtts([array<string|int, mixed> $customAtts = array() ]) : array<string|int, mixed>
Parameters
$customAtts : array<string|int, mixed> = array()

Optional. Empty array by default.

Tags
since
3.7.0

added optional parameter $customAtts.

Return values
array<string|int, mixed>

modifyQueryAtts()

protected modifyQueryAtts(mixed $atts) : array<string|int, mixed>
Parameters
$atts : mixed
Return values
array<string|int, mixed>

removeGetPostsFilters()

protected removeGetPostsFilters() : mixed
Return values
mixed

updatePostRelatedData()

protected updatePostRelatedData(WPPostData $postData) : mixed
Parameters
$postData : WPPostData
Return values
mixed

_addBookingCriteria()

private _addBookingCriteria(mixed $atts) : mixed
Parameters
$atts : mixed
Return values
mixed

_addRoomCriteria()

private _addRoomCriteria(mixed $atts) : mixed
Parameters
$atts : mixed
Return values
mixed

Search results