Exemplo n.º 1
0
 public function save(PropelPDO $con = null)
 {
     parent::save($con);
     $photoId = $this->getPhotographerId();
     switch ($photoId) {
         case 5:
             // Joanie
             $url = "http://www.google.com/calendar/feeds/" . urlencode(sfConfig::get("app_joanie_calendar_id")) . "/private/full";
             $this->getJob()->setGCalIdCustomUrl($url);
             $this->getJob()->save();
             if (!$this->getJob()->getDate("U") > 0) {
                 return;
             }
             $arr = $this->getJob()->createCalendarArray();
             $arr["calUrl"] = $url;
             $event = sfGCalendar::createJobEvent($arr);
             $this->getJob()->setGCalIdCustom($event->id);
             $this->getJob()->setGCalIdCustomUrl($arr["calUrl"]);
             $this->getJob()->save();
             break;
         case 25:
             // Alonso
             $url = "http://www.google.com/calendar/feeds/" . sfConfig::get("app_alonso_calendar_id") . "/private/full";
             $this->getJob()->setGCalIdCustomUrl($url);
             $this->getJob()->save();
             if (!$this->getJob()->getDate("U") > 0) {
                 return;
             }
             $arr = $this->getJob()->createCalendarArray();
             $arr["calUrl"] = $url;
             $event = sfGCalendar::createJobEvent($arr);
             $this->getJob()->setGCalIdCustom($event->id);
             $this->getJob()->setGCalIdCustomUrl($arr["calUrl"]);
             $this->getJob()->save();
             break;
         default:
             break;
     }
 }
Exemplo n.º 2
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     JobPhotographerPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new JobPhotographerPeer();
     }
     return self::$peer;
 }