Returns an Iterator instance for a list of Resource instances.
(in this case, list of emails to be parsed)

@throws \Exception

@return mixed
490705
public function getContentIterator()
    {
        // Initializing output array
        $output = new \ArrayIterator();

        // Getting total number of messages
        $maxMessage = $this->storage->countMessages();

        for($i=1; $i<=$maxMessage; $i++) {
            // Getting the message object
            $message = $this->storage->getMessage($i);

            if ($message instanceof \Zend\Mail\Storage\Message) {
                // Wrapping the result object into an appropriate ResourceInterface instance
                try {
                    $popMessage = new PopMessage();
                    $popMessage->init($this->getName(), $i, $message);
                } catch (\Exception $e) {
                    throw new Exception\SourceGetContentException(
                        sprintf(
                            'Error while getting the content for the resource unique id \'%s\'. Exception is: \'%s\'.',
                            $i,
                            $e->getMessage()
                        )
                    );
                }

                // Adding the wrapping object to the result iterator
                $output->append($popMessage);
            }
        }

        // Returning the result iterator
        return $output;
    }
393562
public function collection()
    {
        if ($this->collection) {
            return $this->collection;
        }

        if (!$this->collectionConfig()) {
            throw new Exception(sprintf(
                'Collection Config required for "%s"',
                get_class($this)
            ));
        }

        $collection = new CollectionLoader([
            'logger'  => $this->logger,
            'factory' => $this->modelFactory()
        ]);

        $collection->setModel($this->proto());
        $collection->setData($this->collectionConfig());

        $this->collection = $collection->load();

        return $this->collection;
    }
850094
public static <E> Iterator<E> get() {
		@SuppressWarnings("unchecked")
		Iterator<E> iter = (Iterator<E>) INSTANCE;
		return iter;
	}
997541
public function actionIndex()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['index']);
        }
        try{
            $searchModel = new UserSearch();
            $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

            return $dataProvider;
        }catch(Exception $e)
        {
            throw new Exception($e);
        }


    }
994927
private function getInstances()
    {
        $response = $this->call($this->tyrUrl . '/' . $this->version . '/instances/');

        $instancesN = json_decode($response);
        if (is_array($instancesN)) {
            $instances = array();
            foreach ($instancesN as $instance) {
                $instances[$instance->id] = $instance->name;
            }
        }

        return $instances;
    }
586504
public function getInstance()
    {
        if (!is_null($this->instance)) {
            return $this->instance;
        }

        if(!class_exists($this->payload['class'])) {
            throw new Exception(
                'Could not find job class ' . $this->payload['class'] . '.'
            );
        }

        if(!method_exists($this->payload['class'], 'perform')) {
            throw new Exception(
                'Job class ' . $this->payload['class'] . ' does not contain a perform method.'
            );
        }

        $this->instance = new $this->payload['class']();
        $this->instance->job = $this;
        $this->instance->args = $this->getArguments();
        $this->instance->queue = $this->queue;
        return $this->instance;
    }
616992
public function getIterator()
    {
        $array = $this->getArrayCopy();

        // Is the collection nested in the array?
        if (isset($this->collectionProperty)) {

            // Locate the collection in the response.
            $collectionFound = false;
            $property = NULL;
            foreach ((array) $this->collectionProperty as $property) {
                if (isset($array[$property])) {
                    $collectionFound = true;
                    break;
                }
            }

            if (!$collectionFound) {
                throw new \OutOfBoundsException('Collection not found in response');
            }

            $array = $array[$property];
        }

        // Build the collection.
        $collection = array();
        foreach ($array as $item) {
            $element = new $this->elementClass($item);
            $collection[(string) $element] = $element;
        }

        return new \ArrayObject($collection);
    }
840038
public static function getIterator()
    {
        if (parent::$_readable === false) {
            /** @see Zend_Session_Exception */
            require_once 'Zend/Session/Exception.php';
            throw new Zend_Session_Exception(parent::_THROW_NOT_READABLE_MSG);
        }

        $spaces  = array();
        if (isset($_SESSION)) {
            $spaces = array_keys($_SESSION);
            foreach($spaces as $key => $space) {
                if (!strncmp($space, '__', 2) || !is_array($_SESSION[$space])) {
                    unset($spaces[$key]);
                }
            }
        }

        return new ArrayObject(array_merge($spaces, array_keys(parent::$_expiringData)));
    }
662122
public function getIterator()
    {
        if (!count($this->errors)) {
            $this->errors[$this->attribute] = $this->getMessage();
        }

        return new \ArrayIterator($this->errors);
    }
875370
public function getIterator()
    {
        $items = array_map(
            function ($item) {
                return is_array($item) ? new ArrayData($item) : $item;
            },
            $this->items
        );
        return new ArrayIterator($items);
    }
375812
protected function _getIterator()
    {
        foreach(array_keys($this->properties) as $key)
            yield $key => $this->__get($key);
    }
1326963
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                MatcherFactory::instance(),
                MatcherVerifier::instance(),
                GeneratorVerifierFactory::instance(),
                IterableVerifierFactory::instance(),
                ExceptionAssertionRecorder::instance(),
                AssertionRenderer::instance()
            );
        }

        return self::$instance;
    }
9393
public function get()
    {
        $m = $this->model;
        if (!$m) {
            throw $this->exception('Specify model_class or define your method handlers');
        }

        if ($m->loaded()) {
            if (!$this->allow_list_one) {
                throw $this->exception('Loading is not allowed');
            }

            return $this->outputOne($m->get());
        }

        if (!$this->allow_list) {
            throw $this->app->exception('Listing is not allowed');
        }

        return $this->outputMany($m->setLimit(100)->getRows());
    }
14408
public function getIterator()
    {
        $iteration_result = array();
        if (\is_array($this->nodes)) {
            foreach ($this->nodes as $node) {
                $iteration_result[] = $this->createChildInstance($node);
            }
        }

        return new \ArrayIterator($iteration_result);
    }
222351
public function getIterator()
    {
        $aResult = array();
        $iStart  = ($this->itemsPerPage * ($this->page - 1));
        if ($iStart < 0) {
            throw new \OutOfBoundsException('Start index cant no be lower then 1');
        }
        try {
            $iRestOfResults                    = ($this->itemsPerPage - 1);
            $mFirstValues                      = $this->collection->seek($iStart);
            $aResult[$this->collection->key()] = $mFirstValues;
            while ($iRestOfResults > 0) {
                $mValue = $this->collection->scNext();
                if ($mValue === AbstractCollection::NOT_SET_FLAG) {
                    throw new \OutOfBoundsException();
                }
                $aResult[$this->collection->key()] = $mValue;
                $iRestOfResults--;
            }

        } catch (\OutOfBoundsException $oException) {
            // do nothing, this exception is not critical
        }
        $sClassName = get_class($this->collection);

        return new $sClassName($aResult);
    }
16781
public function getAll()
    {
        if (!$this->getResource()) {
            return [];
        }
        if ($this->useLocalResource) {
            return $this->localResource;
        }

        // If we're attempting to use a global resource but it doesn't exist, we've got a problem.
        if (!isset($GLOBALS[$this->getResource()])) {
            throw new \Parable\GetSet\Exception(
                "Attempting to use global resource '{$this->getResource()}' but resource not available."
            );
        }

        return $GLOBALS[$this->getResource()];
    }
403903
public function getIterator() {
        $ret = array(
            'id'           => $this->id,
            'contextlevel' => $this->contextlevel,
            'instanceid'   => $this->instanceid,
            'path'         => $this->path,
            'depth'        => $this->depth,
            'locked'       => $this->locked,
        );
        return new ArrayIterator($ret);
    }