Heratio Framework API Reference

LightweightResource
in package
implements ArrayAccess

Lightweight resource wrapper for template compatibility.

Templates access: $resource->title, $resource->slug, $resource->id This wraps a stdClass from EntityQueryService and provides __get/__isset/__toString plus Propel-compatible methods (getTitle, getChildren, getDigitalObject, etc.) so that plugin templates work without Propel.

Tags
author

Johan Pieterse johan@theahg.co.za

Table of Contents

Interfaces

ArrayAccess

Methods

__call()  : mixed
Handle Propel-style getter calls (e.g. getTitle() → $data->title).
__construct()  : mixed
__get()  : mixed
__isset()  : bool
__toString()  : string
getChildren()  : array<string|int, mixed>
Get direct children of this resource as LightweightResource array.
getDescendants()  : array<string|int, mixed>
Get all descendants of this resource.
getDigitalObject()  : mixed
Get the digital object related to this resource.
getLevelOfDescription()  : object|null
Get level of description as an object with a name property.
getParent()  : self|null
Get the parent resource.
getRawData()  : object
Get the raw underlying stdClass data.
getTitle()  : string|null
Get the i18n title with culture fallback.
offsetExists()  : bool
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
toArray()  : array<string|int, mixed>
Convert to array for serialization or debugging.

Methods

__call()

Handle Propel-style getter calls (e.g. getTitle() → $data->title).

public __call(string $name, array<string|int, mixed> $arguments) : mixed

Required because sfOutputEscaperObjectDecorator calls methods, not properties.

Parameters
$name : string
$arguments : array<string|int, mixed>

__isset()

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

getChildren()

Get direct children of this resource as LightweightResource array.

public getChildren([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

Mimics QubitObject::getChildren().

Parameters
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getDescendants()

Get all descendants of this resource.

public getDescendants([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

Uses nested set (lft/rgt) for efficient lookup.

Parameters
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getDigitalObject()

Get the digital object related to this resource.

public getDigitalObject() : mixed

Returns a LightweightDigitalObject with __call support for getName() etc.

getLevelOfDescription()

Get level of description as an object with a name property.

public getLevelOfDescription() : object|null
Return values
object|null

getParent()

Get the parent resource.

public getParent() : self|null
Return values
self|null

getRawData()

Get the raw underlying stdClass data.

public getRawData() : object
Return values
object

getTitle()

Get the i18n title with culture fallback.

public getTitle([array<string|int, mixed> $options = [] ]) : string|null
Parameters
$options : array<string|int, mixed> = []
Return values
string|null

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

toArray()

Convert to array for serialization or debugging.

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

        
On this page

Search results