private function queryPDO(string $strQuery, array $aParams = [])
    {
        $oStmt = $this->oConnector->prepare($strQuery);
        if (!$oStmt->execute($aParams))
            throw new \Exception(__METHOD__ . ' - ' . $oStmt->errorInfo()[2]);

        list($strMethod) = explode(' ', trim($strQuery));
        switch (strtoupper($strMethod)) {

            case 'SELECT':
                return $oStmt->fetchAll(\PDO::FETCH_ASSOC);
                break;

            case 'INSERT':
                return $this->oConnector->lastInsertId();
                break;

            case 'UPDATE':
                return $aParams[':id_value'];
                break;

            case 'DELETE':
            default:
                return true;
                break;
        }
    }
private function queryPDO(string $strQuery, array $aParams = [])
    {
        $oStmt = $this->oConnector->prepare($strQuery);
        if (!$oStmt->execute($aParams))
            throw new \Exception(__METHOD__ . ' - ' . $oStmt->errorInfo()[2]);

        list($strMethod) = explode(' ', trim($strQuery));
        switch (strtoupper($strMethod)) {

            case 'SELECT':
                return $oStmt->fetchAll(\PDO::FETCH_ASSOC);
                break;

            case 'INSERT':
                return $this->oConnector->lastInsertId();
                break;

            case 'UPDATE':
                return $aParams[':id_value'];
                break;

            case 'DELETE':
            default:
                return true;
                break;
        }
    }
private function queryPDO ( string $ strQuery , array $ aParams = [ ] ) { $ oStmt = $ this -> oConnector -> prepare ( $ strQuery ) ; if ( ! $ oStmt -> execute ( $ aParams ) ) throw new \ Exception ( __METHOD__ . ' - ' . $ oStmt -> errorInfo ( ) [ 2 ] ) ; list ( $ strMethod ) = explode ( ' ' , trim ( $ strQuery ) ) ; switch ( strtoupper ( $ strMethod ) ) { case 'SELECT' : return $ oStmt -> fetchAll ( \ PDO :: FETCH_ASSOC ) ; break ; case 'INSERT' : return $ this -> oConnector -> lastInsertId ( ) ; break ; case 'UPDATE' : return $ aParams [ ':id_value' ] ; break ; case 'DELETE' : default : return true ; break ; } }
Execute the query with PDO and return results.

@param string $strQuery SQL query.
@param array $aParams Array of parameters to bind.
@return array|int|bool
Execute the query with PDO and return results .