示例#1
0
 public function copyTo($option)
 {
     $store = new Booking_Model_Store();
     $stores = $store->findAll(array('booking_id' => $this->getId()));
     $this->setId(null)->setValueId($option->getId())->save();
     foreach ($stores as $store) {
         $store->setId(null)->setBookingId($this->getId())->save();
     }
     return $this;
 }
 public function findAction()
 {
     if ($value_id = $this->getRequest()->getParam('value_id')) {
         $booking = $this->getCurrentOptionValue()->getObject();
         $data = array("stores" => array(array()));
         if ($booking->getId()) {
             $store = new Booking_Model_Store();
             $stores = $store->findAll(array('booking_id' => $booking->getId()));
             foreach ($stores as $store) {
                 $data["stores"][] = array('id' => $store->getId(), 'name' => $store->getStoreName());
             }
         }
         $data['page_title'] = $this->getCurrentOptionValue()->getTabbarName();
         $this->_sendHtml($data);
     }
 }