Exemplo n.º 1
0
 public function delete($id, $recursive = true)
 {
     $znid = parent::getValue1($id);
     if ($recursive) {
         foreach ($this->getZoneIds($id) as $subid) {
             if (!$this->delete($subid, $recursive)) {
                 return false;
             }
         }
     } else {
         //UPDATE
     }
     foreach ($this->getAZ()->getAttributes($id) as $a_name) {
         if (!$this->getAZ()->remove($id, $a_name)) {
             return false;
         }
     }
     foreach ($this->getZL()->getIds($id) as $id_linked_zone) {
         if (!$this->getZL()->delete($id, $id_linked_zone)) {
             return false;
         }
     }
     if (!parent::delete($id)) {
         return false;
     }
     if (!parent::inUse(self::$tableValue1, $znid)) {
         //check name node
         $this->zn->delete($znid);
     }
     return true;
 }
 public function delete($id)
 {
     $anid = parent::getValue0($id);
     $avid = parent::getValue1($id);
     if (!parent::delete($id)) {
         return false;
     }
     if (!parent::inUse(self::$tableValue0, $anid)) {
         $this->an->delete($anid);
     }
     if (!parent::inUse(self::$tableValue1, $avid)) {
         $this->av->delete($avid);
     }
     return true;
 }
 protected function delete($id)
 {
     if ($id == null) {
         return false;
     }
     $aid = parent::getValue1($id);
     if (!parent::delete($id)) {
         return false;
     }
     if (!parent::inUse(self::$tableValue1, $aid)) {
         //check node
         $this->a->delete($aid);
     }
     return true;
 }