TypifiedElementCollectionProxy
class TypifiedElementCollectionProxy extends TypifiedElementProxy (View source)
Class for lazy-proxy creation to ensure, that TypifiedElementCollection are really accessed only at moment, when user needs them.
Properties
protected string | $elementClass | Element class, that is allowed in the collection. | from AbstractElementCollection |
protected string | $className | Class name to proxy. | from AbstractProxy |
protected mixed | $object | Object to proxy. | from AbstractProxy |
protected IElementLocator | $locator | Locator, that can be used to find associated elements on a page. | from AbstractProxy |
protected boolean | $locatorUsed | Determines if a locator was used to locate the elements. | from AbstractProxy |
protected IPageFactory | $pageFactory | Page Factory, that allows to create more elements on demand. | from AbstractProxy |
private string | $_name | Name of the element. | from TypifiedElementProxy |
Methods
Initializes proxy for AbstractTypifiedElementCollection.
Determines if an element can be added to a collection.
Offset to set.
Creates new collection by wrapping given array of Node elements.
Determines if class is NodeElement aware.
Checks that element's class is allowed in collection.
No description
Proxies read access for properties to the sub-object.
Proxies write access for properties to the sub-object.
Proxies all methods to sub-object.
Whether an offset exists.
Offset to unset.
Offset to retrieve.
Count elements of an object.
Returns the array iterator.
Locates object inside proxy.
Returns class instance, that was placed inside a proxy.
Details
at line 38
__construct(IElementLocator $locator, IPageFactory $page_factory, string $name)
Initializes proxy for AbstractTypifiedElementCollection.
protected boolean
acceptElement(mixed $element)
Determines if an element can be added to a collection.
at line 55
void
offsetSet(mixed $index, mixed $newval)
Offset to set.
static AbstractElementCollection
fromNodeElements(array $node_elements, string $element_class = null, IPageFactory $page_factory)
Creates new collection by wrapping given array of Node elements.
protected boolean
isNodeElementAware(string $class_name)
Determines if class is NodeElement aware.
protected boolean
assertElement(mixed $element)
Checks that element's class is allowed in collection.
at line 28
Expectation
shouldReceive(string $name)
in AbstractProxy at line 87
IProxy
setClassName(string $class_name)
Sets class name, used inside the proxy.
in AbstractProxy at line 102
mixed
__get(string $property)
Proxies read access for properties to the sub-object.
in AbstractProxy at line 138
void
__set(string $property, mixed $value)
Proxies write access for properties to the sub-object.
in AbstractProxy at line 176
mixed
__call(string $method, array $arguments)
Proxies all methods to sub-object.
in AbstractProxy at line 209
protected NodeElement
locateElement()
Locates element using the locator.
in AbstractProxy at line 222
protected NodeElement[]
locateElements()
Locates elements using the locator.
at line 67
boolean
offsetExists(mixed $index)
Whether an offset exists.
at line 79
void
offsetUnset(mixed $index)
Offset to unset.
at line 91
mixed|null
offsetGet(mixed $index)
Offset to retrieve.
at line 101
integer
count()
Count elements of an object.
at line 111
ArrayIterator
getIterator()
Returns the array iterator.
at line 121
protected mixed
locateObject()
Locates object inside proxy.
at line 154
mixed
getObject()
Returns class instance, that was placed inside a proxy.
in TypifiedElementProxy at line 89
string
getName()
Returns name of the entity.
in TypifiedElementProxy at line 103
ITypifiedElement
setName(string $name)
Sets a name of an element.
This method is used by initialization mechanism and is not intended to be used directly.