public static function getMenusUsuarisOptions($idU, $idS) { $RET = ""; $C = new Criteria(); $C->add(GestioMenusPeer::ACTIU, true); $TOTS = GestioMenusPeer::doSelect($C); $C = new Criteria(); $C->add(self::USUARI_ID, $idU); $C->add(self::ACTIU, true); $C->add(self::SITE_ID, $idS); $PART = UsuarisMenusPeer::doSelect($C); foreach ($TOTS as $OM) { $exist = false; foreach ($PART as $OUM) { $exist = $OM->getMenuId() == $OUM->getMenuId() || $exist; } if (!$exist) { $RET .= '<option id="' . $OM->getMenuId() . '" value="' . $OM->getMenuId() . '">' . addslashes($OM->getTitol()) . '</option>'; } else { $RET .= '<option selected id="' . $OM->getMenuId() . '" value="' . $OM->getMenuId() . '">' . addslashes($OM->getTitol()) . '</option>'; } } return $RET; }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(GestioMenusPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(GestioMenusPeer::DATABASE_NAME); $criteria->add(GestioMenusPeer::MENU_ID, $pks, Criteria::IN); $objs = GestioMenusPeer::doSelect($criteria, $con); } return $objs; }