Пример #1
0
 /**
  * Enter description here...
  *
  * @param integer $id
  */
 static function deleteTeam($id)
 {
     if (empty($id)) {
         return;
     }
     $db = DevblocksPlatform::getDatabaseService();
     /*
      * Notify anything that wants to know when groups delete.
      */
     $eventMgr = DevblocksPlatform::getEventService();
     $eventMgr->trigger(new Model_DevblocksEvent('group.delete', array('group_ids' => array($id))));
     $sql = sprintf("DELETE QUICK FROM team WHERE id = %d", $id);
     $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg());
     /* @var $rs ADORecordSet */
     $sql = sprintf("DELETE QUICK FROM category WHERE team_id = %d", $id);
     $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg());
     /* @var $rs ADORecordSet */
     // [TODO] DAO_GroupSettings::deleteById();
     $sql = sprintf("DELETE QUICK FROM group_setting WHERE group_id = %d", $id);
     $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg());
     /* @var $rs ADORecordSet */
     $sql = sprintf("DELETE QUICK FROM worker_to_team WHERE team_id = %d", $id);
     $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg());
     /* @var $rs ADORecordSet */
     $sql = sprintf("DELETE QUICK FROM group_inbox_filter WHERE group_id = %d", $id);
     $db->Execute($sql) or die(__CLASS__ . '(' . __LINE__ . ')' . ':' . $db->ErrorMsg());
     /* @var $rs ADORecordSet */
     //        DAO_GroupInboxFilter::deleteByMoveCodes(array('t'.$id));
     self::clearCache();
     DAO_Bucket::clearCache();
 }