ReservationRepository extends AbstractRepository
in package

Tags
since
1.0
see
Reservation

Table of Contents

$entitiesCache  : array<string|int, mixed>
$postType  : string
__construct()  : mixed
filterArgs()  : array<string|int, mixed>
findAll()  : array<string|int, mixed>
findAllByBooking()  : array<string|int, Reservation>
findAllByMeta()  : array<string|int, mixed>
Usage: <pre> findAllByMeta($metaKey, $metaValue) findAllByMeta($metaKey, $metaValue, $operator) findAllByMeta($metaKey, $operator) </pre>
findAllByService()  : array<string|int, mixed>
findAllByValueInMeta()  : array<string|int, mixed>
findById()  : AbstractEntity|null
findByMeta()  : AbstractEntity|null
Usage: <pre> findByMeta($metaKey, $metaValue) findByMeta($metaKey, $metaValue, $operator) findByMeta($metaKey, $operator) </pre>
findIdByMeta()  : int
findRandomConfirmed()  : Reservation|null
mapPostsToEntities()  : array<string|int, AbstractEntity>
mapPostToEntity()  : AbstractEntity|null
addActions()  : mixed
defaultQueryArgs()  : array<string|int, mixed>
entitySchema()  : array<string|int, mixed>
getCategories()  : array<string|int, mixed>
getPost()  : WP_Post|null
getPosts()  : array<string|int, WP_Post>|array<string|int, int>
mapPostDataToEntity()  : Reservation
mapPostToPostData()  : array<string|int, mixed>
metaQueryArgs()  : array<string|int, mixed>

Properties

$entitiesCache

protected array<string|int, mixed> $entitiesCache = []
Tags
since
1.0

$postType

protected string $postType
Tags
since
1.0

Methods

__construct()

public __construct(string $postType) : mixed
Parameters
$postType : string
Tags
since
1.0
Return values
mixed

filterArgs()

public filterArgs(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>
Tags
access

protected

since
1.0
Return values
array<string|int, mixed>

findAll()

public findAll([array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed> = []

Optional. @param string|array $args['fields'] 'all', 'ids' or [Key field => Value field], for example: ['id' => 'name'].

Tags
since
1.0
Return values
array<string|int, mixed>

Entities, IDs or mixed values (when "fields" argument is an array).

findAllByBooking()

public findAllByBooking(int $bookingId) : array<string|int, Reservation>
Parameters
$bookingId : int
Tags
since
1.0
Return values
array<string|int, Reservation>

findAllByMeta()

Usage: <pre> findAllByMeta($metaKey, $metaValue) findAllByMeta($metaKey, $metaValue, $operator) findAllByMeta($metaKey, $operator) </pre>

public findAllByMeta(string $metaKey, mixed $metaValue[, string $operator = null ][, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$metaKey : string
$metaValue : mixed
$operator : string = null

Optional.

$args : array<string|int, mixed> = []

Optional.

Tags
since
1.0
Return values
array<string|int, mixed>

Entities, IDs or mixed values.

findAllByService()

public findAllByService(int $serviceId[, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$serviceId : int
$args : array<string|int, mixed> = []

Optional. @param \DateTime|string $args['from_date'] @param \DateTime|string $args['to_date'] @param string|array $args['fields']

Tags
since
1.0
Return values
array<string|int, mixed>

findAllByValueInMeta()

public findAllByValueInMeta(string $metaKey, mixed $value[, array<string|int, mixed> $args = [] ]) : array<string|int, mixed>
Parameters
$metaKey : string
$value : mixed

Value to search in the arrays of postmetas.

$args : array<string|int, mixed> = []

Optional.

Tags
since
1.0
Return values
array<string|int, mixed>

Entities, IDs or mixed values.

findById()

public findById(int $id[, bool $forceReload = false ]) : AbstractEntity|null
Parameters
$id : int

Optional. Current post by default.

$forceReload : bool = false

Optional. False by default.

Tags
since
1.0
since
1.2

$id is optional.

Return values
AbstractEntity|null

findByMeta()

Usage: <pre> findByMeta($metaKey, $metaValue) findByMeta($metaKey, $metaValue, $operator) findByMeta($metaKey, $operator) </pre>

public findByMeta(string $metaKey, mixed $metaValue[, string $operator = null ]) : AbstractEntity|null
Parameters
$metaKey : string
$metaValue : mixed
$operator : string = null

Optional.

Tags
since
1.0
Return values
AbstractEntity|null

findIdByMeta()

public findIdByMeta(string $metaKey, mixed $metaValue) : int
Parameters
$metaKey : string
$metaValue : mixed
Tags
global

\wpdb $wpdb

Return values
int

Post ID or 0.

findRandomConfirmed()

public findRandomConfirmed() : Reservation|null
Tags
since
1.13.0
global

wpdb $wpdb

Return values
Reservation|null

mapPostsToEntities()

public mapPostsToEntities(array<string|int, WP_Post$posts) : array<string|int, AbstractEntity>
Parameters
$posts : array<string|int, WP_Post>
Tags
since
1.0
Return values
array<string|int, AbstractEntity>

mapPostToEntity()

public mapPostToEntity(WP_Post|null $post) : AbstractEntity|null
Parameters
$post : WP_Post|null
Tags
since
1.0
Return values
AbstractEntity|null

addActions()

protected addActions() : mixed
Tags
since
1.0
Return values
mixed

defaultQueryArgs()

protected defaultQueryArgs() : array<string|int, mixed>
Tags
since
1.0
Return values
array<string|int, mixed>

entitySchema()

protected entitySchema() : array<string|int, mixed>
Tags
since
1.0
Return values
array<string|int, mixed>

getCategories()

protected getCategories(string $taxonomy, array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$taxonomy : string
$args : array<string|int, mixed>

@param int $args['post_id'] Optional. Custom argument. Retrieve the terms of the taxonomy that are attached to the post.

Tags
since
1.0
Return values
array<string|int, mixed>

[Term ID => \WP_Term]

getPost()

protected getPost(int $id) : WP_Post|null
Parameters
$id : int
Tags
since
1.0
Return values
WP_Post|null

getPosts()

protected getPosts(array<string|int, mixed> $args) : array<string|int, WP_Post>|array<string|int, int>
Parameters
$args : array<string|int, mixed>
Tags
since
1.0
Return values
array<string|int, WP_Post>|array<string|int, int>

mapPostDataToEntity()

protected mapPostDataToEntity(array<string|int, mixed> $postData) : Reservation
Parameters
$postData : array<string|int, mixed>
Tags
since
1.0
Return values
Reservation

mapPostToPostData()

protected mapPostToPostData(WP_Post $post) : array<string|int, mixed>
Parameters
$post : WP_Post
Tags
since
1.0
Return values
array<string|int, mixed>

metaQueryArgs()

protected metaQueryArgs(string $metaKey, mixed $metaValue, string|null $operator) : array<string|int, mixed>
Parameters
$metaKey : string
$metaValue : mixed
$operator : string|null
Tags
since
1.0
Return values
array<string|int, mixed>

Search results