예제 #1
0
 public function executeThank()
 {
     if (!empty($_POST['audio'])) {
         $wtf = new WhiteboardTutorFeedback();
         $wtf->setWhiteboardChatId($_COOKIE["whiteboardChatId"]);
         $wtf->setExpertId($_COOKIE["ratingExpertId"]);
         $wtf->setAudio(!empty($_POST["audio"]) ? $_POST["audio"] : '');
         $wtf->setUsability(!empty($_POST["use"]) ? $_POST["use"] : '');
         $wtf->setOverall(!empty($_POST["overall"]) ? $_POST["overall"] : '');
         $wtf->setFeedback(!empty($_POST["feedback"]) ? $_POST["feedback"] : '');
         $wtf->setCreatedAt(date("Y-m-d H:i:s"));
         $wtf->save();
     }
     if (isset($_SERVER['HTTP_COOKIE'])) {
         $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
         foreach ($cookies as $cookie) {
             $parts = explode('=', $cookie);
             $name = trim($parts[0]);
             if ($name != "rayku_frontend") {
                 $this->getResponse()->setCookie($name, "", time() - 3600, '/', sfConfig::get('app_cookies_domain'));
             }
         }
     }
 }
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      WhiteboardTutorFeedback $value A WhiteboardTutorFeedback object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(WhiteboardTutorFeedback $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }