Exemplo n.º 1
0
 public function saveZoneHasRoomList($con = null)
 {
     if (!$this->isValid()) {
         throw $this->getErrorSchema();
     }
     if (!isset($this->widgetSchema['zone_has_room_list'])) {
         // somebody has unset this widget
         return;
     }
     if (is_null($con)) {
         $con = $this->getConnection();
     }
     $c = new Criteria();
     $c->add(ZoneHasRoomPeer::ZONE_ID, $this->object->getPrimaryKey());
     ZoneHasRoomPeer::doDelete($c, $con);
     $values = $this->getValue('zone_has_room_list');
     if (is_array($values)) {
         foreach ($values as $value) {
             $obj = new ZoneHasRoom();
             $obj->setZoneId($this->object->getPrimaryKey());
             $obj->setRoomId($value);
             $obj->save();
         }
     }
 }
Exemplo n.º 2
0
 public function addParentZone($parentZone)
 {
     $zoneHasRoom = new ZoneHasRoom();
     $zoneHasRoom->setZoneId($parentZone);
     $this->addZoneHasRoom($zoneHasRoom);
 }