get() public method

When called with no paramaters, this returns all objects wrapped by the DOMQuery. Typically, these are DOMElement objects (unless you have used map(), xpath(), or other methods that can select non-elements). When called with an index, it will return the item in the DOMQuery with that index number. Calling this method does not change the DOMQuery (e.g. it is non-destructive). You can use qp()->get() to iterate over all elements matched. You can also iterate over qp() itself (DOMQuery implementations must be Traversable). In the later case, though, each item will be wrapped in a DOMQuery object. To learn more about iterating in QueryPath, see {@link examples/techniques.php}.
See also: eq()
See also: SplObjectStorage
public get ( integer $index = null, boolean $asObject = false ) : mixed
$index integer If specified, then only this index value will be returned. If this index is out of bounds, a NULL will be returned.
$asObject boolean If this is TRUE, an SplObjectStorage object will be returned instead of an array. This is the preferred method for extensions to use.
return mixed If an index is passed, one element will be returned. If no index is present, an array of all matches will be returned.
 private function extractMovies(DOMQuery $movieDomList)
 {
     $movieResult = array();
     for ($i = 1; $i < $movieDomList->count(); $i++) {
         $movieDom = new DOMQuery($movieDomList->get($i));
         /* @var $movieDom DOMQuery */
         $movieData = array();
         $titledom = $movieDom->find('h4')->first();
         if (!$titledom) {
             continue;
         }
         $movieData['title'] = preg_replace('/\\s+\\(\\d\\d\\d\\d\\)$/', '', trim($titledom->text()));
         $imgDomTmp = $movieDom->find('.image_sm img')->first();
         $movieData['poster_url'] = $imgDomTmp ? $imgDomTmp->attr('src') : '';
         $certImg = $movieDom->find('.certimage')->first();
         $movieData['rated'] = $certImg ? $certImg->attr('title') : '';
         $timeSpan = $movieDom->find('time')->first();
         $movieData['runtime'] = $timeSpan ? intval(trim($timeSpan->text())) : -1;
         $ratingDom = $movieDom->find('[itemprop=ratingValue]')->first();
         $movieData['user_rating'] = $ratingDom ? floatval($ratingDom->text()) / self::MAX_RATING : 0;
         $metaDom = $movieDom->find('span.nobr')->eq(1);
         $metaDomScoreTmp = explode("/", preg_replace('/[^0-9\\/]+/', '', $metaDom->text()));
         $movieData['critic_rating'] = floatval($metaDomScoreTmp[0]) / self::MAX_METASCORE;
         //var_dump($movieDom->find('.showtimes')->count());exit;
         //echo (preg_replace("/\s+/", " ", $movieDom->text())), "<br/><br/>";
         //continue;
         $movieResult[] = array('movie' => $movieData, 'showtimes' => $this->extractTimes($movieDom->find('.showtimes'), $movieDom));
     }
     return $movieResult;
 }