ReservedRoomRepository
extends AbstractPostRepository
in package
Table of Contents
- $bookingReservedRooms : array<string|int, mixed>
- $items : mixed
- $persistence : CPTPersistence
- $type : mixed
- __construct() : mixed
- delete() : int
- fillBookingReservedRooms() : mixed
- findAll() : mixed
- findAllByBooking() : array<string|int, ReservedRoom>
- findById() : ReservedRoom
- findByMeta() : mixed
- findOne() : mixed
- mapEntityToPostData() : WPPostData
- mapPostToEntity() : ReservedRoom
- persistence() : CPTPersistence
- save() : int
- mapPostsToEntity() : mixed
Properties
$bookingReservedRooms
protected
array<string|int, mixed>
$bookingReservedRooms
= array()
$items
protected
mixed
$items
= array()
$persistence
protected
CPTPersistence
$persistence
$type
protected
mixed
$type
= 'reserved_room'
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.
fillBookingReservedRooms()
public
fillBookingReservedRooms(array<string|int, int>|array<string|int, WP_Post> $bookingsPosts) : mixed
Parameters
- $bookingsPosts : array<string|int, int>|array<string|int, WP_Post>
Return values
mixed —findAll()
public
findAll([array<string|int, mixed> $atts = array() ]) : mixed
Parameters
- $atts : array<string|int, mixed> = array()
Return values
mixed —findAllByBooking()
public
findAllByBooking(int $bookingId[, mixed $force = false ]) : array<string|int, ReservedRoom>
Parameters
- $bookingId : int
- $force : mixed = false
Return values
array<string|int, ReservedRoom> —findById()
public
findById(int $id[, bool $force = false ]) : ReservedRoom
Parameters
- $id : int
- $force : bool = false
-
Optional. Default false.
Return values
ReservedRoom —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.
findOne()
public
findOne([mixed $atts = array() ]) : mixed
Parameters
- $atts : mixed = array()
Return values
mixed —mapEntityToPostData()
public
mapEntityToPostData(ReservedRoom $entity) : WPPostData
Parameters
- $entity : ReservedRoom
Return values
WPPostData —mapPostToEntity()
public
mapPostToEntity(WP_Post|int $post) : ReservedRoom
Parameters
- $post : WP_Post|int
Return values
ReservedRoom —persistence()
public
persistence() : CPTPersistence
Tags
Return values
CPTPersistence —save()
public
save(type &$entity) : int
Parameters
- $entity : type
Return values
int —mapPostsToEntity()
protected
mapPostsToEntity(mixed $posts) : mixed
Parameters
- $posts : mixed