Properties

$id

$id : 

Type

$language

$language : 

Type

$path

$path : 

Type

$type

$type : 

Type

$version

$version : 

Type

$data

$data : 

Type

$originaldata

$originaldata : 

Type

$state

$state : 

Type

$git_repo

$git_repo : 

Type

$local

$local : 

Type

$assignable

$assignable : 

Type

$recently_added

$recently_added : 

Type

$encrypted

$encrypted : null

Indicator if this is an encrypted content type

Type

null

Methods

__construct()

__construct(string  $type, integer|string  $id, string  $language = null) 

Construct a new generic object

Parameters

string $type

The element type name

integer|string $id

The element id

string $language

The element language or null for raw resolve

__get()

__get(string  $name) : mixed|null

Magic getter function

Parameters

string $name

The value name

Returns

mixed|null

GitRepo()

GitRepo() : \FAA\Git|null

Get the related git instance

Will open a git instance on demand, this method is cached locally

Returns

\FAA\Git|null

Id()

Id() : integer|string

Expose the object id

Provide an interface to extract the current id, can be numeric or string

Returns

integer|string —

The id as fixed value

Data()

Data() : array

Direct get data method

Returns

array

RecentlyAdded()

RecentlyAdded() : boolean

Was recently added

Returns

boolean

IsAssignable()

IsAssignable() : boolean|null

Is assignable Check if this is an assignable content type

Returns

boolean|null

Existing()

Existing() : boolean

Check if this instance is existing in the file system

Returns

boolean

FormattedId()

FormattedId(string  $prefix, string  $pad_string = '0', integer  $pad_length = 5, integer  $pad_type = STR_PAD_LEFT) : string

expose the formatted object id provide an interface to extract the current id with formatting options

Parameters

string $prefix

A prefix

string $pad_string

The pad character

integer $pad_length

The padding length

integer $pad_type

The padding type

Returns

string —

The formatted id

GetVersion()

GetVersion() : string

expose the GIT revision provide an interface to extract the current version hash

Returns

string —

the object version

GetLanguage()

GetLanguage() : string

expose the language provide an interface to extract the current language

Returns

string —

the object language

SetLanguage()

SetLanguage(string  $language) 

Set the language of this instance

Parameters

string $language

The language key

GetState()

GetState() : \FAA\Obj\Result

Expose the state Provide an interface to extract the current status

Returns

\FAA\Obj\Result

the object status

SetPlainAttribute()

SetPlainAttribute(string  $keys, mixed  $value) 

set a plain attribute update or add a plain attribute to this object

Parameters

string $keys

The searched attribute key

mixed $value

The new value

GetPlainOriginalAttribute()

GetPlainOriginalAttribute(string  $key, string  $language = '') : mixed

Get original value get a plain resolved attribute value from the local storage

Parameters

string $key

The searched attribute key

string $language

The searched language key or false for all

Returns

mixed —

The found value

GetPlainAttribute()

GetPlainAttribute(string  $key, string  $language = '') : mixed

get plain value get a plain resolved attribute value from the local storage

Parameters

string $key

The searched attribute key

string $language

The searched language key or false for all

Returns

mixed —

The found value

Contains()

Contains(array  $filter, string  $language = null) : boolean

Check if attribute contains the search string

Matches the filters against the given attribute selected

Parameters

array $filter

List of filters with operation, target attribute and value attr string The attribute to check op string The search operator e.g. LIKE value string The search string * matches all

string $language

The loader value to get the attributes in

Returns

boolean —

When matching true

GetType()

GetType() : string

expose the type provide an interface to extract the current type of this object

Returns

string —

the object type name

LastSaveTime()

LastSaveTime() : integer

Get save time

Expose the last save time of main object file provide an interface to extract the last save time

Returns

integer —

the object last save time

GetCreationTime()

GetCreationTime() : string|null

Get creation time

Expose the creation time of main object file provide an interface to extract the time when the file was generated or, registered in git

Returns

string|null

GetFileById()

GetFileById(string  $name, string  $attr = 'files') : array|null

Get a single file by id

Parameters

string $name

The file id

string $attr

The attribute sourc type

Returns

array|null

GetPlainOfRevision()

GetPlainOfRevision(string  $hash, boolean  $tolerate_error = false) : \FAA\Obj\Result

Fetch a certain version of a file based on the given hash

Parameters

string $hash

The git revision hash

boolean $tolerate_error

Ignore index errors on demand

Returns

\FAA\Obj\Result

A system result object

GetListOfRevisions()

GetListOfRevisions() : \FAA\Obj\Result

List versions

Load and provide a list of stored revisions for this objects. Will use git to determinate this list.

Returns

\FAA\Obj\Result

A system result object

GetRelativePath()

GetRelativePath() : string

expose the storage path provide an interface to extract the current path of this object

Returns

string —

the object storage path

StorageRoot()

StorageRoot() : string

Ger storage root Get the storage root folder, absolute

Returns

string —

The storage root folder

GetPath()

GetPath() : string

expose the storage path provide an interface to extract the current path of this object

Returns

string —

the object storage path

Delete()

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

Do delete Delete entity from file system and git repository This method can delete this content object from our local storage system

Parameters

boolean $skip

Skip hooks on demand

Returns

\FAA\Obj\Result

A default system result set

Convert()

Convert(string  $target) : \FAA\Obj\Result

Convert to other object type

Parameters

string $target

The target name

Returns

\FAA\Obj\Result

The conversion result

Copy()

Copy(mixed  $target = null) : \FAA\Obj\Result

clone 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

mixed $target

For compatibility reasons with several subtypes this argument is required

Returns

\FAA\Obj\Result

A default system result set

Save()

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

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

SearchFields()

SearchFields() : array

Get search fields

Create a array of search fields. The type can be i,d,s,dt

Returns

array —

A list of search fields, with field, type and value

GeneralSearchFields()

GeneralSearchFields() : array

Get list of general search fields

Returns

array

ToPlainReducedObject()

ToPlainReducedObject(array  $fields, string  $language = null) : Object

Convert to reduced plain data set Translate and expose the current data attribute as plain resolved object with filtered attributes

Parameters

array $fields

List of attributes to show

string $language

A system language code or empty for raw setup

Returns

Object —

A simple attribute based php object

ToPlainObject()

ToPlainObject(string  $language = null, boolean  $with_parent = true) : \stdClass

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 $with_parent

When set to true the attributes will be resolved witch parent attributes included

Returns

\stdClass —

A simple attribute based php object

loadFromSrcCached()

loadFromSrcCached() 

Load the instance values from storage

loadFromSrc()

loadFromSrc() 

Load data from source

Fetch the content master file for this entry by given path The data will be stored in the local data property, when the data is encrypted it will be locally decrypted This function has not return value but a side effect on status. It will handle the cases when an entity is encryped in a transparent way

GetNextOfSequence()

GetNextOfSequence() 

Get next id Load a new id from buffer and set it as primary key

Has side effect to set the local states

setPlainSubAttribute()

setPlainSubAttribute(array  $target, mixed  $value, string  $path) 

set a sub attribute update or add a plain attribute to this object this method will resolve the . separated path until the end of the limb is reached and $this->data was updated

Parameters

array $target

A reference tho the this->data branch the update is target of

mixed $value

The new value

string $path

The remaining path components to target