public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = FlagsPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setUserId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setNewsletter($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setMail($arr[$keys[3]]); } }
public function countFlagss($criteria = null, $distinct = false, $con = null) { include_once 'lib/model/om/BaseFlagsPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } $criteria->add(FlagsPeer::USER_ID, $this->getId()); return FlagsPeer::doCount($criteria, $distinct, $con); }
public function executeSubmitcontactsettings() { $userid = $this->getUser()->getAttribute('userid'); $mail = $this->getRequestParameter('mail'); $newsletter = $this->getRequestParameter('newsletter'); $c = new Criteria(); $c->add(FlagsPeer::USER_ID, $userid); $flags = FlagsPeer::doSelectOne($c); if (!$flags) { $flags = new Flags(); } $flags->setUserId($userid); $flags->setMail($mail); $flags->setNewsletter($newsletter); $flags->save(); $this->setFlash('notice', 'Your preferences have been saved sucessfully'); $this->redirect('settings/contactsettings'); }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(FlagsPeer::ID, $pks, Criteria::IN); $objs = FlagsPeer::doSelect($criteria, $con); } return $objs; }