Class Collection (namespace Nette\Collections)
SPL ArrayObject customization.
ArrayObject | --Collection
Implements interfaces:
Public Method Summary | |
---|---|
Collection |
|
void |
append
(mixed $item)
Appends the specified element to the end of this collection.
|
void |
clear
()
Removes all of the elements from this collection.
|
bool |
contains
(mixed $item)
Returns true if this collection contains the specified item.
|
void |
exchangeArray
($array)
Not supported. Use import().
|
string |
getClass
()
Returns the name of the class of this object.
|
ArrayIterator |
getIterator
()
Returns the iterator.
|
void |
import
(array|\Traversable $arr)
Import from array or any traversable object.
|
bool |
isReadOnly
()
Returns a value indicating whether collection is read-only.
|
bool |
remove
(mixed $item)
Removes the first occurrence of the specified element.
|
void |
setReadOnly
()
Prevent any more modifications.
|
void |
__call
($name, $args)
Call to undefined method.
|
static void |
__callStatic
($name, $args)
Call to undefined static method.
|
& void |
__get
($name)
Returns property value. Do not call directly.
|
bool |
__isset
(string $name)
Is property defined?
|
void |
__set
($name, $value)
Sets value of a property. Do not call directly.
|
void |
__unset
($name)
Access to undeclared property.
|
Protected Method Summary | |
---|---|
protected void |
beforeAdd
(mixed $item)
Responds when the item is about to be added to the collection.
|
protected void |
beforeRemove
()
Responds when an item is about to be removed from the collection.
|
protected int|FALSE |
search
(mixed $item)
Returns the index of the first occurrence of the specified element,.
|
protected void |
setArray
(array $array)
Protected exchangeArray().
|
Methods Inherited From ArrayObject (Internal Class) |
---|
constructor __construct ( $array ), append ( $value ), asort ( ), count ( ), exchangeArray ( $array ), getArrayCopy ( ), getFlags ( ), getIterator ( ), getIteratorClass ( ), ksort ( ), natcasesort ( ), natsort ( ), offsetExists ( $index ), offsetGet ( $index ), offsetSet ( $index, $newval ), offsetUnset ( $index ), setFlags ( $flags ), setIteratorClass ( $iteratorClass ), uasort ( $cmp_function ), uksort ( $cmp_function ) |
Constant Summary |
---|
Constants Inherited From ArrayObject (Internal Class) |
---|
ARRAY_AS_PROPS = 2, STD_PROP_LIST = 1 |
Variable Summary | ||||
---|---|---|---|---|
protected string | $checkFunc |
|
line 40 function to verify type |
|
protected string | $itemType |
|
line 37 type (class, interface, PHP type) |
|
protected bool | $readOnly | FALSE |
line 43 |
Method Details | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 52 __constructpublic Collection __construct ([array $arr = Overridden in child classes as:
|
|||||||||||||||||||||
line 85 appendpublic void append (mixed $item) Appends the specified element to the end of this collection. Overridden in child classes as: Implementation of:
|
|||||||||||||||||||||
line 192 beforeAddprotected void beforeAdd (mixed $item) Responds when the item is about to be added to the collection.
|
|||||||||||||||||||||
line 219 beforeRemoveprotected void beforeRemove () Responds when an item is about to be removed from the collection.
|
|||||||||||||||||||||
line 131 clearpublic void clear () Removes all of the elements from this collection. Implementation of:
|
|||||||||||||||||||||
line 144 containspublic bool contains (mixed $item) Returns true if this collection contains the specified item. Implementation of:
|
|||||||||||||||||||||
line 246 exchangeArraypublic void exchangeArray ($array) Not supported. Use import().
|
|||||||||||||||||||||
line 274 getClasspublic string getClass () Returns the name of the class of this object.
|
|||||||||||||||||||||
line 236 getIteratorpublic ArrayIterator getIterator () Returns the iterator.
|
|||||||||||||||||||||
line 157 importpublic void import (array|\Traversable $arr) Import from array or any traversable object. Overridden in child classes as:
|
|||||||||||||||||||||
line 175 isReadOnlypublic bool isReadOnly () Returns a value indicating whether collection is read-only. Implementation of:
|
|||||||||||||||||||||
line 99 removepublic bool remove (mixed $item) Removes the first occurrence of the specified element. Overridden in child classes as: Implementation of:
|
|||||||||||||||||||||
line 119 searchprotected int|FALSE search (mixed $item) Returns the index of the first occurrence of the specified element,. or FALSE if this collection does not contain this element. Overridden in child classes as:
|
|||||||||||||||||||||
line 258 setArrayprotected void setArray (array $array) Protected exchangeArray().
|
|||||||||||||||||||||
line 72 setReadOnlypublic void setReadOnly () Prevent any more modifications.
|
|||||||||||||||||||||
line 286 __callpublic void __call ($name, $args) Call to undefined method.
|
|||||||||||||||||||||
line 298 __callStaticpublic static void __callStatic ($name, $args) Call to undefined static method.
|
|||||||||||||||||||||
line 311 __getpublic void & __get ($name) Returns property value. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 336 __issetpublic bool __isset (string $name) Is property defined? Overridden in child classes as:
|
|||||||||||||||||||||
line 323 __setpublic void __set ($name, $value) Sets value of a property. Do not call directly. Overridden in child classes as:
|
|||||||||||||||||||||
line 348 __unsetpublic void __unset ($name) Access to undeclared property. Overridden in child classes as:
|