quote($this->login); $idGroupList = $this->_getUserIdGroupList(); if (empty($idGroupList)) throw new Exception("Brak przypisanych grup do użytkownika"); $sqlIdGroupsCsv = implode(",", $idGroupList); $sqlWhereAnd[] = " ( m.`A_RECORD_CREATE_AUTHOR` = {$sqlUserLogin} or ( m.`userTargetType` in('everyone') or ( m.`userTargetType`='user' and m.`userTargetName` = {$sqlUserLogin} ) or ( m.`userTargetType`='group' and m.`userTargetName` in( {$sqlIdGroupsCsv} ) ) ) ) "; $sqlWhereAnd[] = " m.`A_STATUS` in('OFF_HARD', 'DELETED') "; // TODO: parse where/ogc, etc. return implode(" and ", $sqlWhereAnd); } }