PaymentRepository
extends AbstractRepository
in package
Tags
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, Payment>
- findAllByMeta() : array<string|int, mixed>
- Usage: <pre> findAllByMeta($metaKey, $metaValue) findAllByMeta($metaKey, $metaValue, $operator) findAllByMeta($metaKey, $operator) </pre>
- findAllByValueInMeta() : array<string|int, mixed>
- findAllExpired() : array<string|int, Payment>
- findById() : AbstractEntity|null
- findByMeta() : AbstractEntity|null
- Usage: <pre> findByMeta($metaKey, $metaValue) findByMeta($metaKey, $metaValue, $operator) findByMeta($metaKey, $operator) </pre>
- findByTransactionId() : Payment|null
- findIdByMeta() : int
- havePendingPayments() : bool
- 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() : Payment
- mapPostToPostData() : array<string|int, mixed>
- metaQueryArgs() : array<string|int, mixed>
Properties
$entitiesCache
protected
array<string|int, mixed>
$entitiesCache
= []
Tags
$postType
protected
string
$postType
Tags
Methods
__construct()
public
__construct(string $postType) : mixed
Parameters
- $postType : string
Tags
Return values
mixed —filterArgs()
public
filterArgs(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
Tags
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
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, mixed> $args = array() ]) : array<string|int, Payment>
Parameters
- $bookingId : int
- $args : array<string|int, mixed> = array()
-
Optional.
Tags
Return values
array<string|int, Payment> —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
Return values
array<string|int, mixed> —Entities, IDs or mixed values.
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
Return values
array<string|int, mixed> —Entities, IDs or mixed values.
findAllExpired()
public
findAllExpired([array<string|int, mixed> $args = array() ]) : array<string|int, Payment>
Parameters
- $args : array<string|int, mixed> = array()
-
Optional.
Tags
Return values
array<string|int, Payment> —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
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
Return values
AbstractEntity|null —findByTransactionId()
public
findByTransactionId(string $translationId) : Payment|null
Parameters
- $translationId : string
Tags
Return values
Payment|null —findIdByMeta()
public
findIdByMeta(string $metaKey, mixed $metaValue) : int
Parameters
- $metaKey : string
- $metaValue : mixed
Tags
Return values
int —Post ID or 0.
havePendingPayments()
public
havePendingPayments() : bool
Tags
Return values
bool —mapPostsToEntities()
public
mapPostsToEntities(array<string|int, WP_Post> $posts) : array<string|int, AbstractEntity>
Parameters
- $posts : array<string|int, WP_Post>
Tags
Return values
array<string|int, AbstractEntity> —mapPostToEntity()
public
mapPostToEntity(WP_Post|null $post) : AbstractEntity|null
Parameters
- $post : WP_Post|null
Tags
Return values
AbstractEntity|null —addActions()
protected
addActions() : mixed
Tags
Return values
mixed —defaultQueryArgs()
protected
defaultQueryArgs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —entitySchema()
protected
entitySchema() : array<string|int, mixed>
Tags
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
Return values
array<string|int, mixed> —[Term ID => \WP_Term]
getPost()
protected
getPost(int $id) : WP_Post|null
Parameters
- $id : int
Tags
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
Return values
array<string|int, WP_Post>|array<string|int, int> —mapPostDataToEntity()
protected
mapPostDataToEntity(array<string|int, mixed> $postData) : Payment
Parameters
- $postData : array<string|int, mixed>
Tags
Return values
Payment —mapPostToPostData()
protected
mapPostToPostData(WP_Post $post) : array<string|int, mixed>
Parameters
- $post : WP_Post
Tags
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