/**
  * Delete entity from database.
  *
  * @return bool|false|int
  */
 public function delete()
 {
     $parent_result = parent::delete();
     if ($parent_result && $this->get('google_event_id')) {
         $google = new AB_Google();
         $google->loadByStaffId($this->get('staff_id'));
         $google->delete($this->get('google_event_id'));
         return $parent_result;
     } else {
         return false;
     }
 }
Пример #2
0
 /**
  * Delete entity from database
  *(and delete event in Google Calendar if it exists).
  *
  * @return bool|false|int
  */
 public function delete()
 {
     $result = parent::delete();
     if ($result && $this->hasGoogleCalendarEvent()) {
         $this->deleteGoogleCalendarEvent();
     }
     return $result;
 }
Пример #3
0
 public function delete()
 {
     parent::delete();
     if ($this->get('avatar_path')) {
         unlink($this->get('avatar_path'));
     }
 }