public function execute($config = null)
    {

        if(null == $config){
            $pdo = Config::getDefault()->getPdo();
        }else if($config instanceof \PDO){
            $pdo = $config;
        }else if($config instanceof Config){
            $pdo = $config->getPdo();
        }else{
            throw new BadParameterException('First parameter of FQuery::execute is not correct');
        }

        $stmt = $this->getPdoStatement($pdo);

        if ($stmt->execute()) {
            return $stmt;

        } else {
            // TODO : handle errors ".__FILE__.":".__LINE__;
            throw new QueryFailedException($stmt);
            //return false;
        }

    }
public function execute($config = null)
    {

        if(null == $config){
            $pdo = Config::getDefault()->getPdo();
        }else if($config instanceof \PDO){
            $pdo = $config;
        }else if($config instanceof Config){
            $pdo = $config->getPdo();
        }else{
            throw new BadParameterException('First parameter of FQuery::execute is not correct');
        }

        $stmt = $this->getPdoStatement($pdo);

        if ($stmt->execute()) {
            return $stmt;

        } else {
            // TODO : handle errors ".__FILE__.":".__LINE__;
            throw new QueryFailedException($stmt);
            //return false;
        }

    }
public function execute ( $ config = null ) { if ( null == $ config ) { $ pdo = Config :: getDefault ( ) -> getPdo ( ) ; } else if ( $ config instanceof \ PDO ) { $ pdo = $ config ; } else if ( $ config instanceof Config ) { $ pdo = $ config -> getPdo ( ) ; } else { throw new BadParameterException ( 'First parameter of FQuery::execute is not correct' ) ; } $ stmt = $ this -> getPdoStatement ( $ pdo ) ; if ( $ stmt -> execute ( ) ) { return $ stmt ; } else { // TODO : handle errors ".__FILE__.":".__LINE__; throw new QueryFailedException ( $ stmt ) ; //return false; } }
Executes the query from the given pdo object
@param \PDO|Config|null $pdo
@return \PDOStatement the pdo statement ready to fetch
Executes the query from the given pdo object