public function removeZone(Zone $zone)
 {
     if (isset($this->zones[$zone->getId()])) {
         unset($this->zones[$zone->getId()]);
         $this->removeZoneImpl($zone);
     }
 }
 public function onResult(QueryResult $result)
 {
     $this->zone->setId($result->insertId);
 }
Esempio n. 3
0
 public function onResult(QueryResult $result)
 {
     $this->zone->setId($result->insertId);
     $this->dataProvider->onAddedZoneCallback($this->zone);
 }
Esempio n. 4
0
 protected function addZoneImpl(Zone $zone)
 {
     $zone->setId($this->nextId());
     $this->getMain()->getServer()->getScheduler()->scheduleAsyncTask(new FileWriteTask($this->dir . "zones/" . $zone->getId() . ".weaz", json_encode(["Id" => $zone->getId(), "Space" => serialize($zone->getSpace()), "Type" => $zone->getType()])));
 }
 protected function removeZoneImpl(Zone $zone)
 {
     $this->stream->addQuery(new QueryRequest($this->getMain(), "DELETE FROM wea_zones WHERE id={$zone->getId()}"));
 }