Example #1
0
 /**
  * Gets a single PcHideableHintsSetting object, which is related to this object by a one-to-one relationship.
  *
  * @param      PropelPDO $con
  * @return     PcHideableHintsSetting
  * @throws     PropelException
  */
 public function getPcHideableHintsSetting(PropelPDO $con = null)
 {
     if ($this->singlePcHideableHintsSetting === null && !$this->isNew()) {
         $this->singlePcHideableHintsSetting = PcHideableHintsSettingPeer::retrieveByPK($this->id, $con);
     }
     return $this->singlePcHideableHintsSetting;
 }
Example #2
0
 public function getHideableHintsSetting()
 {
     $ret = array();
     $setting = PcHideableHintsSettingPeer::retrieveByPK($this->getId());
     if (is_object($setting)) {
         $ret[PcHideableHintsSettingPeer::INBOX_HINT] = (int) $setting->getInbox();
         $ret[PcHideableHintsSettingPeer::TODO_HINT] = (int) $setting->getTodo();
         $ret[PcHideableHintsSettingPeer::COMPLETED_HINT] = (int) $setting->getCompleted();
         $ret[PcHideableHintsSettingPeer::QUOTE_HINT] = (int) $setting->getQuote();
     } else {
         $ret[PcHideableHintsSettingPeer::INBOX_HINT] = 0;
         $ret[PcHideableHintsSettingPeer::TODO_HINT] = 0;
         $ret[PcHideableHintsSettingPeer::COMPLETED_HINT] = 0;
         $ret[PcHideableHintsSettingPeer::QUOTE_HINT] = 0;
     }
     return $ret;
 }
 public function executeHideHint(sfWebRequest $request)
 {
     $user = PcUserPeer::getLoggedInUser();
     $userId = $user->getId();
     $hintId = $request->getParameter('hintId');
     if ($hintId) {
         $setting = PcHideableHintsSettingPeer::retrieveByPK($userId);
         if (!is_object($setting)) {
             $setting = new PcHideableHintsSetting();
             $setting->setId($userId);
         }
         switch ($hintId) {
             case PcHideableHintsSettingPeer::INBOX_HINT:
                 $setting->setInbox(1);
                 break;
             case PcHideableHintsSettingPeer::TODO_HINT:
                 $setting->setTodo(1);
                 break;
             case PcHideableHintsSettingPeer::COMPLETED_HINT:
                 $setting->setCompleted(1);
                 break;
             case PcHideableHintsSettingPeer::QUOTE_HINT:
                 $setting->setQuote(1);
                 break;
         }
         $setting->save();
     }
     return $this->renderDefault();
 }