Scalr\Model\Collections\EntityIterator::__call PHP Method

__call() public method

Implements some convenient magic methods
public __call ( string $name, array $args ) : ArrayCollection
$name string The method name
$args array The arguments
return ArrayCollection
    public function __call($name, $args)
    {
        //Implements filterBy{PropertyName} method set
        if (strpos($name, 'filterBy') === 0) {
            $property = lcfirst(substr($name, 8));
            $value = isset($args[0]) ? $args[0] : null;
            return new ArrayCollection(iterator_to_array(new PropertyFilterIterator($this, $property, $value)));
        }
        throw new BadMethodCallException(sprintf("Could not find method %s for class %s", $name, get_class($this)));
    }