public function getAllRawQuery($iPage = null, $iPerPage = null, $aData = [])
    {
        //  Fetch all objects from the table
        $oDb = Factory::service('Database');
        $oDb->select($this->sTableAlias . '.*');
        $oDb->select('ue.email,u.first_name,u.last_name,u.profile_img,u.gender');

        //  Apply common items; pass $aData
        $this->getCountCommonEvent($aData);

        // --------------------------------------------------------------------------

        //  Facilitate pagination
        if (!is_null($iPage)) {

            /**
             * Adjust the page variable, reduce by one so that the offset is calculated
             * correctly. Make sure we don't go into negative numbers
             */

            $iPage--;
            $iPage = $iPage < 0 ? 0 : $iPage;

            //  Work out what the offset should be
            $iPerPage = is_null($iPerPage) ? 50 : (int) $iPerPage;
            $iOffset  = $iPage * $iPerPage;

            $oDb->limit($iPerPage, $iOffset);
        }

        return $oDb->get($this->sTable . ' ' . $this->sTableAlias);
    }