public function search($sKeywords, $iPage = null, $iPerPage = null, array $aData = [], $bIncludeDeleted = false)
    {
        //  If the second parameter is an array then treat as if called with search($sKeywords, null, null, $aData);
        if (is_array($iPage)) {
            $aData = $iPage;
            $iPage = null;
        }

        $this->applySearchConditionals($aData, $sKeywords);

        return (object) [
            'page'    => $iPage,
            'perPage' => $iPerPage,
            'total'   => $this->countAll($aData),
            'data'    => $this->getAll($iPage, $iPerPage, $aData, $bIncludeDeleted),
        ];
    }