\FAA\Obj\GenericRelation

Summary

Methods
Properties
Constants
__construct()
CopyWithContent()
Move()
GetFolder()
GetAssignedInfo()
HasDetailView()
IsValid()
SearchFields()
ToPlainObject()
RawObject()
Position()
Delete()
Save()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$resolved_content
N/A

Properties

$resolved_content

$resolved_content :

Type

Methods

__construct()

__construct(string  $root,integer  $id = null,string  $language = null,string  $sub_type = 'relation')

Relation constructor.

Parameters

string $root

The root folder, cal also be the id

integer $id

The relation id or, null for new relations

string $language

The local language

string $sub_type

A possible sub type

CopyWithContent()

CopyWithContent(string  $target,string  $position = null,integer  $order = -1): \FAA\Obj\Result

Move to other folder

Parameters

string $target

Path to the target folder

string $position

The target position

integer $order

The new order offset

Returns

\FAA\Obj\Result —

A system result object

Move()

Move(string  $target,string  $position = null,integer  $order = -1): \FAA\Obj\Result

Move to other folder

Parameters

string $target

Path to the target folder

string $position

The target position

integer $order

The new order offset

Returns

\FAA\Obj\Result —

A system result object

GetFolder()

GetFolder(): string

Get the parent folder of the relation

Returns

string

GetAssignedInfo()

GetAssignedInfo(string  $key = 'type'): boolean

Get the assignment info from properties

Parameters

string $key

The key, type|value

Returns

boolean

HasDetailView()

HasDetailView(): boolean

Has a detail view attribute on true

Returns

boolean

IsValid()

IsValid(array  $filter = array()): boolean

Is valid for filter

Test if a relation is valid for the defined time span, enabled and has a certain content type assigned

Parameters

array $filter

A set of filters date_to int A timestamp for date to, when empty use time() date_from int A timestamp for date from, when empty use time() ignore_active bool When true, the is active flag is not checked content_types array List of allowed content types

Returns

boolean

SearchFields()

SearchFields(): array

Return search indexer fields

Convert instance to search indexer values

Returns

array —

The search indexer fields

ToPlainObject()

ToPlainObject(string  $language = null,boolean  $resolve = true): Object

Convert to plain data set translate and expose the current data attribute as plain resolved object

Parameters

string $language

A system language code or empty for raw setup

boolean $resolve

When set to true the sub content will also be resolve, parent attributers are always present

Returns

Object —

A simple attribute based php object

RawObject()

RawObject(string  $language = null): \FAA\Obj\Generic\BaseContent

Resolve to raw object

Fetches the linked raw object from storage based on the assigned values. This method is cached locally.

Parameters

string $language

Language code

Returns

\FAA\Obj\Generic\BaseContent —

A system base content object

Position()

Position(): string

Get the target position

Returns

string —

The position in template

Delete()

Delete(boolean  $skip = false,boolean  $full = false): \FAA\Obj\Result

Delete relation

Delete the relation and on demand remove the assigned content

Parameters

boolean $skip

Skip hooks on demand

boolean $full

When true, the sub content will be deleted

Returns

\FAA\Obj\Result —

A system result object

Save()

Save(boolean  $force_new_id = false): \FAA\Obj\Result

Store relation

Save object entry in file system and git repository store the current payload inside the system storage and commit the changes to the local repository

Parameters

boolean $force_new_id

Indicate force new id on demand (local id empty)

Returns

\FAA\Obj\Result —

A default system result set