Container
extends Sand
in package
implements
Embedable
uses
Glue
Class Container.
Table of Contents
Interfaces
- Embedable
- Interface Embedable.
Properties
- $drawStatus : bool
- $embedName : null|string
- $finalized : bool
- $pageParts : array<string|int, mixed>
Methods
- __construct() : mixed
- A container that can contain embedded objects that are rendered.
- __toString() : string
- Render Obect (and its contents) as string.
- addAsFirst() : mixed
- Inserts as the first element in the object.
- addItem() : mixed
- Include next element into current object.
- addItemCustom() : mixed
- Inserts another element into the object.
- addItems() : array<string|int, mixed>
- Insert an array of elements.
- addNextTo() : Embedable|string
- Inserts another element after the existing one.
- addToLastItem() : null|Container
- Adds an item to the last inserted item.
- afterAdd() : void
- Method executed after adding object into new one.
- draw() : void
- Recursive draw object and its contents.
- drawAllContents() : void
- It recursively scans all inserted objects and calls their draw ().
- drawIfNotDrawn() : void
- Draw contents not drawn yet.
- embedablize() : Embedable
- Always returns Embedable item.
- emptyContents() : void
- Empty container contents.
- finalize() : void
- Method executed before rendering.
- finalized() : bool
- getContents() : mixed
- Contents.
- getFirstPart() : mixed
- Returns the first inserted item.
- getItemsCount() : int
- Returns number of enclosed items in current or given object.
- getRendered() : string
- Returns the rendered contents of objects.
- isEmpty() : bool
- Is the element empty?
- isFinalized() : bool
- Returns the status of the part finalization of the flag.
- lastItem() : Brick|mixed
- Vrací odkaz na poslední vloženou položku.
- setEmbedName() : bool
- Notify component about its embed name.
- setFinalized() : void
- Set label of parts finalized.
- suicide() : mixed
- Allows an already inserted object to be removed from the tree for rendering.
Properties
$drawStatus
public
bool
$drawStatus
Has the page already been rendered?
$embedName
public
null|string
$embedName
Name of the embedded part
$finalized
public
bool
$finalized
Is class finalized?
$pageParts
public
array<string|int, mixed>
$pageParts
Array of objects and fragments to draw
Methods
__construct()
A container that can contain embedded objects that are rendered.
public
__construct([Embedable|string $initialContent = null ]) : mixed
Parameters
- $initialContent : Embedable|string = null
-
value or EaseObject with draw () method
__toString()
Render Obect (and its contents) as string.
public
__toString() : string
Return values
stringaddAsFirst()
Inserts as the first element in the object.
public
& addAsFirst(mixed $pageItem[, string $pageItemName = null ]) : mixed
Parameters
- $pageItem : mixed
-
value or EaseObject with draw () method
- $pageItemName : string = null
-
Under this name, object is inserted into the tree
Return values
mixed —A link to the embedded object
addItem()
Include next element into current object.
public
addItem(mixed $pageItem) : mixed
Include next element into current object
Parameters
- $pageItem : mixed
-
value or EaseClass with draw() method
addItemCustom()
Inserts another element into the object.
public
static & addItemCustom(Embedable|string $pageItem, Embedable $context) : mixed
Parameters
- $pageItem : Embedable|string
-
value or EaseObject with draw () method
- $context : Embedable
-
Object into which elements / items are inserted
Return values
mixed —Pointer to embed object
addItems()
Insert an array of elements.
public
addItems(array<string|int, mixed> $itemes) : array<string|int, mixed>
Parameters
- $itemes : array<string|int, mixed>
-
value field or EaseObject with draw () method
Return values
array<string|int, mixed> —inserted items
addNextTo()
Inserts another element after the existing one.
public
& addNextTo(mixed $pageItem) : Embedable|string
Parameters
- $pageItem : mixed
-
value or EaseObject with draw () method
Return values
Embedable|string —a link to the embedded object
addToLastItem()
Adds an item to the last inserted item.
public
addToLastItem(object $pageItem) : null|Container
Parameters
- $pageItem : object
-
value or EaseObject with draw () method
Return values
null|Container —success
afterAdd()
Method executed after adding object into new one.
public
afterAdd() : void
Method executed after adding object into new one
draw()
Recursive draw object and its contents.
public
draw() : void
Recursive draw object and its contents
drawAllContents()
It recursively scans all inserted objects and calls their draw ().
public
drawAllContents() : void
drawIfNotDrawn()
Draw contents not drawn yet.
public
drawIfNotDrawn() : void
embedablize()
Always returns Embedable item.
public
static embedablize(mixed $item) : Embedable
Parameters
- $item : mixed
Return values
EmbedableemptyContents()
Empty container contents.
public
emptyContents() : void
finalize()
Method executed before rendering.
public
finalize() : void
Method executed before rendering
finalized()
public
finalized([bool|null $state = = 'null' ]) : bool
Get/Set finalization flag
Parameters
- $state : bool|null = = 'null'
Return values
boolgetContents()
Contents.
public
getContents() : mixed
getFirstPart()
Returns the first inserted item.
public
getFirstPart() : mixed
getItemsCount()
Returns number of enclosed items in current or given object.
public
getItemsCount() : int
Return values
intgetRendered()
Returns the rendered contents of objects.
public
getRendered() : string
Return values
stringisEmpty()
Is the element empty?
public
isEmpty() : bool
Return values
bool —emptiness
isFinalized()
Returns the status of the part finalization of the flag.
public
isFinalized() : bool
Return values
boollastItem()
Vrací odkaz na poslední vloženou položku.
public
& lastItem() : Brick|mixed
Return values
Brick|mixedsetEmbedName()
Notify component about its embed name.
public
setEmbedName(string $embedName) : bool
Notify component about its embed name
Parameters
- $embedName : string
-
parent::$pageParts[$embedName] == self
Return values
boolsetFinalized()
Set label of parts finalized.
public
setFinalized([bool $flag = true ]) : void
Parameters
- $flag : bool = true
-
finalization flag
suicide()
Allows an already inserted object to be removed from the tree for rendering.
public
suicide() : mixed