RateRepository extends AbstractPostRepository
in package

Table of Contents

$items  : mixed
$persistence  : CPTPersistence
$type  : mixed
__construct()  : mixed
delete()  : int
duplicate()  : int
findAll()  : type
findAllActiveByRoomType()  : array<string|int, Rate>
findAllByRoomType()  : array<string|int, Rate>
findById()  : Rate
findByMeta()  : mixed
findDefaultForRoomType()  : Rate|false
findOne()  : mixed
isExistsForRoomType()  : mixed
mapEntityToPostData()  : WPPostData
mapPostToEntity()  : Rate
persistence()  : CPTPersistence
save()  : int
mapPostsToEntity()  : mixed

Properties

$items

protected mixed $items = array()

$persistence

protected CPTPersistence $persistence

$type

protected mixed $type = 'rate'

Methods

__construct()

public __construct(CPTPersistence $persistence) : mixed
Parameters
$persistence : CPTPersistence
Return values
mixed

delete()

public delete(type $entity) : int
Parameters
$entity : type
Return values
int

Id of deleted entity. 0 on failure.

duplicate()

public duplicate(Rate $rate) : int
Parameters
$rate : Rate
Return values
int

findAll()

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

findAllActiveByRoomType()

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

findAllByRoomType()

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

findById()

public findById(int $id[, bool $force = false ]) : Rate
Parameters
$id : int
$force : bool = false
Return values
Rate

findByMeta()

public findByMeta(string $key, mixed $value) : mixed
Parameters
$key : string
$value : mixed
Return values
mixed

TODO Bug: will find the latest entity with the right meta_key and null meta_value; with a wrong meta_key will return null.

findDefaultForRoomType()

public findDefaultForRoomType(type $roomTypeId[, type $atts = array() ]) : Rate|false
Parameters
$roomTypeId : type
$atts : type = array()
Return values
Rate|false

findOne()

public findOne([mixed $atts = array() ]) : mixed
Parameters
$atts : mixed = array()
Return values
mixed

isExistsForRoomType()

public isExistsForRoomType(mixed $roomTypeId[, mixed $atts = array() ]) : mixed
Parameters
$roomTypeId : mixed
$atts : mixed = array()
Return values
mixed

mapEntityToPostData()

public mapEntityToPostData(Rate $entity) : WPPostData
Parameters
$entity : Rate
Return values
WPPostData

mapPostToEntity()

public mapPostToEntity(int|WP_Post $post) : Rate
Parameters
$post : int|WP_Post
Return values
Rate

persistence()

public persistence() : CPTPersistence
Tags
since
3.7.2
Return values
CPTPersistence

save()

public save(type &$entity) : int
Parameters
$entity : type
Return values
int

mapPostsToEntity()

protected mapPostsToEntity(mixed $posts) : mixed
Parameters
$posts : mixed
Return values
mixed

Search results