/** * Overload of the dpObject::getDeniedRecords * to ensure that the projects owned by denied companies are denied. * * @author handco <*****@*****.**> * @see dpObject::getAllowedRecords */ function getDeniedRecords($uid) { $aBuf1 = parent::getDeniedRecords($uid); $oCpy = new CCompany(); // Retrieve which projects are allowed due to the company rules $aCpiesAllowed = $oCpy->getAllowedRecords($uid, 'company_id,company_name'); $q = new DBQuery(); $q->addTable('projects'); $q->addQuery('project_id'); if (count($aCpiesAllowed)) { $q->addWhere('NOT (project_company IN (' . implode(',', array_keys($aCpiesAllowed)) . '))'); } $sql = $q->prepare(); $q->clear(); $aBuf2 = db_loadColumn($sql); return array_merge($aBuf1, $aBuf2); }