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
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>
__construct()
public
__construct(object $data) : mixed
Parameters
- $data : object
__get()
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__toString()
public
__toString() : string
Return values
stringgetChildren()
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|nullgetParent()
Get the parent resource.
public
getParent() : self|null
Return values
self|nullgetRawData()
Get the raw underlying stdClass data.
public
getRawData() : object
Return values
objectgetTitle()
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|nulloffsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
toArray()
Convert to array for serialization or debugging.
public
toArray() : array<string|int, mixed>