AbstractProxy
class AbstractProxy extends AbstractElementCollection implements IProxy (View source)
Class for lazy-proxy creation to ensure, that elements 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. | |
protected mixed | $object | Object to proxy. | |
protected IElementLocator | $locator | Locator, that can be used to find associated elements on a page. | |
protected boolean | $locatorUsed | Determines if a locator was used to locate the elements. | |
protected IPageFactory | $pageFactory | Page Factory, that allows to create more elements on demand. |
Methods
Initializes proxy for the element.
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
Sets class name, used inside the proxy.
Proxies read access for properties to the sub-object.
Proxies write access for properties to the sub-object.
Proxies all methods to sub-object.
Locates element using the locator.
Locates elements using the locator.
Whether a 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 72
__construct(IElementLocator $locator, IPageFactory $page_factory)
Initializes proxy for the element.
protected boolean
acceptElement(mixed $element)
Determines if an element can be added to a collection.
at line 241
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)
at line 102
mixed
__get(string $property)
Proxies read access for properties to the sub-object.
at line 138
void
__set(string $property, mixed $value)
Proxies write access for properties to the sub-object.
at line 176
mixed
__call(string $method, array $arguments)
Proxies all methods to sub-object.
at line 209
protected NodeElement
locateElement()
Locates element using the locator.
at line 222
protected NodeElement[]
locateElements()
Locates elements using the locator.
at line 255
boolean
offsetExists(mixed $index)
Whether a offset exists.
at line 269
void
offsetUnset(mixed $index)
Offset to unset.
at line 283
mixed|null
offsetGet(mixed $index)
Offset to retrieve.
at line 295
integer
count()
Count elements of an object.
at line 307
ArrayIterator
getIterator()
Returns the array iterator.
at line 319
abstract protected mixed
locateObject()
Locates object inside proxy.
at line 326
mixed
getObject()
Returns class instance, that was placed inside a proxy.