protected function prepFetch()
    {
        if ($this->oosql_sub) {
            return $this;
        }
        if (!$this->oosql_select instanceof oosql) {
            $this->select();
        }
        $this->oosql_select->exe();

        if (!$this->oosql_stmt) {

            $msg = 'Query returned no results! ' . $this->sql();
            throw new \Exception($msg, 9814, null);
        }
        if (!is_array($this->oosql_fetchChanged)) {
            $this->oosql_stmt->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, $this->oosql_class);
        } else {
            call_user_func_array(array($this->oosql_stmt, 'setFetchMode'), $this->oosql_fetchChanged);
        }

    }
protected function prepFetch()
    {
        if ($this->oosql_sub) {
            return $this;
        }
        if (!$this->oosql_select instanceof oosql) {
            $this->select();
        }
        $this->oosql_select->exe();

        if (!$this->oosql_stmt) {

            $msg = 'Query returned no results! ' . $this->sql();
            throw new \Exception($msg, 9814, null);
        }
        if (!is_array($this->oosql_fetchChanged)) {
            $this->oosql_stmt->setFetchMode(\PDO::FETCH_CLASS | \PDO::FETCH_PROPS_LATE, $this->oosql_class);
        } else {
            call_user_func_array(array($this->oosql_stmt, 'setFetchMode'), $this->oosql_fetchChanged);
        }

    }
protected function prepFetch ( ) { if ( $ this -> oosql_sub ) { return $ this ; } if ( ! $ this -> oosql_select instanceof oosql ) { $ this -> select ( ) ; } $ this -> oosql_select -> exe ( ) ; if ( ! $ this -> oosql_stmt ) { $ msg = 'Query returned no results! ' . $ this -> sql ( ) ; throw new \ Exception ( $ msg , 9814 , null ) ; } if ( ! is_array ( $ this -> oosql_fetchChanged ) ) { $ this -> oosql_stmt -> setFetchMode ( \ PDO :: FETCH_CLASS | \ PDO :: FETCH_PROPS_LATE , $ this -> oosql_class ) ; } else { call_user_func_array ( array ( $ this -> oosql_stmt , 'setFetchMode' ) , $ this -> oosql_fetchChanged ) ; } }
Returns the results of a SELECT if any
@throws \InvalidArgumentException
@throws \Exception
@return \Phiber\oosql\oosql|\Phiber\oosql\collection
Returns the results of a SELECT if any