FileAccess Orion

BookableResource extends Basic
in package
Uses Images, RangeActive, MainFolder

Define system bookable resource object

Tags
category

Core content type

author

Tobias Teichner webmaster@teichner.biz

since

File available since v3.18.17

Table of Contents

$  : array<string|int, mixed>|null
$  : string|null
$  : string|null
$  : array<string|int, mixed>
$folder  : FolderTree|null
Buffer for linked main folder
$ignore_hash_fields  : array<string|int, mixed>
$relation_id  : string|null
$_bookingsDb  : BookingsDBAL|null
__construct()  : mixed
Bookable resource constructor.
ArticleIds()  : array<string|int, mixed>
AssignImage()  : Result
Assign an image from instance
Author()  : User|null
Get the original author of the task
Copy()  : Result|null
CreateExtra()  : Result
Create a new extra
Delete()  : Result|null
Delete a booking resource but delete it entirely including all related contents
DeleteExtra()  : Result
Delete the extra
FetchExtras()  : Result
Fetch extra list
GeneralSearchFields()  : array<string|int, mixed>
The general search fields
GetExtra()  : Result
Fetch single extra
GetPrimaryPicture()  : Asset|null
Get the primary picture
Guests()  : Result
Load all booked guests
Hash()  : string
Generate hash of current contents
Images()  : array<string|int, mixed>|array<string|int, Asset>
List images
IsActive()  : bool
Check is active state
MainFolder()  : Folder|null
Resolve the main project of this article
MainFolderRelation()  : string|null
MainImage()  : Asset|null
Get main image
Save()  : Result|null
Store the bookable resource including a specific folder
SearchFields()  : array<string|int, mixed>
Get search fields
ToPlainObject()  : stdClass
UpdateExtra()  : Result
Update the extra
bookingsDb()  : BookingsDBAL
extrasPath()  : string
Helper to get the extras path
writeExtra()  : Result
Store extras

Properties

$ignore_hash_fields

protected array<string|int, mixed> $ignore_hash_fields = ['last_changed_by', 'last_changed_at']

$relation_id

protected string|null $relation_id = null

Methods

__construct()

Bookable resource constructor.

public __construct([string|null $id = null ][, null|string $language = null ]) : mixed
Parameters
$id : string|null = null

The bookable resource id

$language : null|string = null

The local language or null

Return values
mixed

ArticleIds()

public ArticleIds() : array<string|int, mixed>
Return values
array<string|int, mixed>

AssignImage()

Assign an image from instance

public AssignImage(Asset $asset) : Result
Parameters
$asset : Asset

An asset instance

Return values
Result

The result object

Author()

Get the original author of the task

public Author() : User|null
Return values
User|null

CreateExtra()

Create a new extra

public CreateExtra(string $type, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$type : string
$data : array<string|int, mixed>
$individual : bool = true
Return values
Result

Delete()

Delete a booking resource but delete it entirely including all related contents

public Delete([false $skip = false ]) : Result|null
Parameters
$skip : false = false
Return values
Result|null

DeleteExtra()

Delete the extra

public DeleteExtra(string $type[, string|null $id = null ][, bool $individual = true ]) : Result
Parameters
$type : string

The extras type

$id : string|null = null

The id or null to drop all of certain kind

$individual : bool = true

Is individual file or, in all full list?

Return values
Result

FetchExtras()

Fetch extra list

public FetchExtras(string $type[, bool $individual = true ]) : Result
Parameters
$type : string
$individual : bool = true
Return values
Result

GeneralSearchFields()

The general search fields

public GeneralSearchFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

GetExtra()

Fetch single extra

public GetExtra(string $type, string $id) : Result
Parameters
$type : string
$id : string
Return values
Result

GetPrimaryPicture()

Get the primary picture

public GetPrimaryPicture() : Asset|null
Return values
Asset|null

Guests()

Load all booked guests

public Guests([string $l = FAA_DEFAULT_LANGUAGE ]) : Result
Parameters
$l : string = FAA_DEFAULT_LANGUAGE
Return values
Result

Hash()

Generate hash of current contents

public Hash() : string
Return values
string

Images()

List images

public Images([bool $resolved = false ]) : array<string|int, mixed>|array<string|int, Asset>

Get the content of the images attribute relation Will generate and return an empty array hen attribute is not filled

Parameters
$resolved : bool = false
Return values
array<string|int, mixed>|array<string|int, Asset>

IsActive()

Check is active state

public IsActive([array<string|int, mixed>|null $row = null ][, string $from = 'datefrom' ][, string $to = 'dateto' ][, int|null $now = null ]) : bool

Check if the element is active and valid at the current time

Parameters
$row : array<string|int, mixed>|null = null
$from : string = 'datefrom'
$to : string = 'dateto'
$now : int|null = null
Return values
bool

Entry is active based on date from and date to property

MainFolder()

Resolve the main project of this article

public MainFolder([string|null $root = null ]) : Folder|null
Parameters
$root : string|null = null
Return values
Folder|null

MainFolderRelation()

public MainFolderRelation([string|null $root = null ]) : string|null
Parameters
$root : string|null = null
Return values
string|null

MainImage()

Get main image

public MainImage() : Asset|null
Return values
Asset|null

Save()

Store the bookable resource including a specific folder

public Save([false $force_new_id = false ][, string|null $target = null ]) : Result|null
Parameters
$force_new_id : false = false
$target : string|null = null
Return values
Result|null

SearchFields()

Get search fields

public SearchFields() : array<string|int, mixed>
Return values
array<string|int, mixed>

The search fields

ToPlainObject()

public ToPlainObject([null $language = null ][, bool $with_parent = true ]) : stdClass
Parameters
$language : null = null
$with_parent : bool = true
Return values
stdClass

UpdateExtra()

Update the extra

public UpdateExtra(string $type, string $id, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$type : string

The extras type

$id : string

The item primary key

$data : array<string|int, mixed>

The new data

$individual : bool = true

Is individual file or in all full list?

Return values
Result

extrasPath()

Helper to get the extras path

private extrasPath(string $type) : string
Parameters
$type : string
Return values
string

writeExtra()

Store extras

private writeExtra(string $file, array<string|int, mixed> $data[, bool $individual = true ]) : Result
Parameters
$file : string

The target file

$data : array<string|int, mixed>

The new row

$individual : bool = true

Save in individual file?

Return values
Result

Search results