protected function scrape($columns)
    {
        if (!$this->contents) {
            throw new ContentNotFoundException();
        }

        $results = array();

        foreach ($this->contents as $id => $content) {
            $results = array_merge($results, $this->getMatcher()->getMatches($content, $id));
        }

        if ($results) {
            // Order by
            if ($this->orderBy) {
                usort($results, call_user_func_array('self::makeComparer', $this->orderBy));
            }
            // Skip & Take
            if ($this->skip > 0 || $this->take) {
                $results = array_slice($results, $this->skip, $this->take);
            }
            // Select columns
            if (!in_array('*', $columns)) {
                $results = array_map(function ($v) use($columns) {
                    return array_intersect_key($v, array_flip($columns));
                }, $results);
            }
        }

        if ($this->reverse) {
            krsort($results);
        }

        $this->clear();

        return $results;
    }
protected function scrape($columns)
    {
        if (!$this->contents) {
            throw new ContentNotFoundException();
        }

        $results = array();

        foreach ($this->contents as $id => $content) {
            $results = array_merge($results, $this->getMatcher()->getMatches($content, $id));
        }

        if ($results) {
            // Order by
            if ($this->orderBy) {
                usort($results, call_user_func_array('self::makeComparer', $this->orderBy));
            }
            // Skip & Take
            if ($this->skip > 0 || $this->take) {
                $results = array_slice($results, $this->skip, $this->take);
            }
            // Select columns
            if (!in_array('*', $columns)) {
                $results = array_map(function ($v) use($columns) {
                    return array_intersect_key($v, array_flip($columns));
                }, $results);
            }
        }

        if ($this->reverse) {
            krsort($results);
        }

        $this->clear();

        return $results;
    }
protected function scrape ( $ columns ) { if ( ! $ this -> contents ) { throw new ContentNotFoundException ( ) ; } $ results = array ( ) ; foreach ( $ this -> contents as $ id => $ content ) { $ results = array_merge ( $ results , $ this -> getMatcher ( ) -> getMatches ( $ content , $ id ) ) ; } if ( $ results ) { // Order by if ( $ this -> orderBy ) { usort ( $ results , call_user_func_array ( 'self::makeComparer' , $ this -> orderBy ) ) ; } // Skip & Take if ( $ this -> skip > 0 || $ this -> take ) { $ results = array_slice ( $ results , $ this -> skip , $ this -> take ) ; } // Select columns if ( ! in_array ( '*' , $ columns ) ) { $ results = array_map ( function ( $ v ) use ( $ columns ) { return array_intersect_key ( $ v , array_flip ( $ columns ) ) ; } , $ results ) ; } } if ( $ this -> reverse ) { krsort ( $ results ) ; } $ this -> clear ( ) ; return $ results ; }
The actual scraping.

@param array $columns
@throws ContentNotFoundException

@return array
The actual scraping .