ElementProxy
class ElementProxy extends AbstractPartProxy implements IElement (View source)
Class for lazy-proxy creation to ensure, that BEM 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. | 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. | from AbstractPartProxy |
Methods
Initializes BEM element proxy.
Determines if an element can be added to a collection.
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.
Locates object inside proxy.
Returns element instance.
Details
at line 36
__construct(string $name, IElementLocator $locator, IPageFactory $page_factory)
Initializes BEM element proxy.
protected boolean
acceptElement(mixed $element)
Determines if an element can be added to a collection.
in AbstractProxy 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 26
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.
in AbstractProxy at line 255
boolean
offsetExists(mixed $index)
Whether a offset exists.
in AbstractProxy at line 269
void
offsetUnset(mixed $index)
Offset to unset.
in AbstractProxy at line 283
mixed|null
offsetGet(mixed $index)
Offset to retrieve.
in AbstractProxy at line 295
integer
count()
Count elements of an object.
in AbstractProxy at line 307
ArrayIterator
getIterator()
Returns the array iterator.
at line 49
protected mixed
locateObject()
Locates object inside proxy.
at line 65
mixed
getObject()
Returns element instance.
in AbstractPartProxy at line 59
string
getName()
Returns name of the entity.