LazyRecord\BaseCollection::fetch PHP Method

fetch() public method

Build sql and Fetch from current query, make a query to database.
public fetch ( ) : OperationResult
return OperationResult
    public function fetch()
    {
        /* fetch by current query */
        $dsId = $this->getSchema()->getReadSourceId();
        $conn = ConnectionManager::getInstance()->getConnection($dsId);
        $driver = $conn->createQueryDriver();
        $arguments = new ArgumentArray();
        $this->_lastSql = $sql = $this->getCurrentReadQuery()->toSql($driver, $arguments);
        $this->_vars = $vars = $arguments->toArray();
        $this->handle = $conn->prepareAndExecute($sql, $vars);
        return Result::success('Updated', array('sql' => $sql));
    }