Ejemplo n.º 1
0
 public function delete(PropelPDO $con = null)
 {
     $logEntry = new Log();
     $logEntry->setWhen(time());
     $logEntry->setPropelClass("Project");
     $logEntry->setSfGuardUserProfileId(sfContext::getInstance()->getUser()->getUserId());
     $logEntry->setMessage("Project deleted.");
     $logEntry->setLogMessageTypeId(sfConfig::get("app_log_type_delete"));
     $logEntry->setPropelId($this->getId());
     $logEntry->save();
     parent::delete($con);
 }
Ejemplo n.º 2
0
 /**
  * Delete project
  *
  * @param void
  * @return boolean
  */
 function delete()
 {
     $this->clearMessages();
     $this->clearTaskLists();
     $this->clearMilestones();
     $this->clearFiles();
     $this->clearFolders();
     $this->clearForms();
     $this->clearPermissions();
     $this->clearLogs();
     return parent::delete();
 }
Ejemplo n.º 3
0
 public function getYear($format = '')
 {
     return date('Y', strtotime(parent::getYear()));
 }
Ejemplo n.º 4
0
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new ProjectPeer();
     }
     return self::$peer;
 }
Ejemplo n.º 5
0
 /**
  * Delete project
  *
  * @param void
  * @return boolean
  */
 protected function deleteSingle()
 {
     @set_time_limit(0);
     $this->clearMessages();
     $this->clearTasks();
     $this->clearMilestones();
     $this->clearFiles();
     $this->clearForms();
     $this->clearPermissions();
     $this->clearLogs();
     $this->clearRoles();
     $this->clearMails();
     $this->clearWebpages();
     $this->clearEvents();
     $this->clearCompanies();
     $this->clearTimeslots();
     return parent::delete();
 }
Ejemplo n.º 6
0
 /**
  * Delete project and all realted data
  *
  * @param void
  * @return null
  */
 function delete()
 {
     db_begin_work();
     $delete = parent::delete();
     if ($delete && !is_error($delete)) {
         ProjectObjects::deleteByProject($this);
         ProjectUsers::deleteByProject($this);
         PinnedProjects::deleteByProject($this);
         search_index_remove($this->getId(), 'Project');
         clean_project_permissions_cache($this);
         event_trigger('on_project_deleted', array($this));
         db_commit();
     } else {
         db_rollback();
     }
     // if
     return $delete;
 }