コード例 #1
0
 public function delete()
 {
     // Remove records in jos_businesses_businesses_tags
     foreach ($this->getService('com://admin/businesses.model.businesses_tags')->business($this->id)->getList() as $value) {
         $this->getService('com://admin/businesses.model.businesses_tags')->businesses_business_id($this->id)->businesses_tag_id($value->businesses_tag_id)->getItem()->delete();
     }
     return parent::delete();
 }
コード例 #2
0
 public function delete()
 {
     $result = parent::delete();
     $featured = $this->getService('com://admin/articles.database.row.featured');
     $featured->id = $this->id;
     if ($featured->load()) {
         $featured->delete();
     }
     return $result;
 }
コード例 #3
0
ファイル: category.php プロジェクト: kedweber/com_carousel
 public function delete()
 {
     // Before the delete we reset all the items connected to this category.
     $items = $this->getService('com://admin/carousel.model.items')->carousel_category_id($this->id)->getList();
     foreach ($items as $item) {
         $item->enabled = false;
         $item->cck_category_id = null;
         $item->save();
     }
     return parent::delete();
 }
コード例 #4
0
 public function delete()
 {
     $return = parent::delete();
     if ($return) {
         $controller = $this->getService('com://admin/files.controller.file', array('request' => array('container' => $this->container)));
         $controller->path($this->path)->delete();
         $relations = $this->getService('com://admin/attachments.database.table.relations')->select(array('attachments_attachment_id' => $this->id));
         $relations->delete();
     }
     return $return;
 }
コード例 #5
0
 public function delete()
 {
     return parent::delete();
 }
コード例 #6
0
ファイル: module.php プロジェクト: raeldc/com_learn
	/**
	 * Deletes the row form the database.
	 *
	 * Customized in order to implement cascading delete
	 *
	 * @return boolean	If successfull return TRUE, otherwise FALSE
	 */
	public function delete()
	{
		$result = parent::delete();
		
		if($this->getStatus() != KDatabase::STATUS_FAILED) 
		{	
		    KFactory::get('com://admin/extensions.database.table.menus')
			    ->select(array('moduleid' => $this->id))
			    ->delete();
		}

		return $result;
	}
コード例 #7
0
ファイル: user.php プロジェクト: raeldc/nooku-server
 public function delete()
 {
     $user = JFactory::getUser();
     // Don't allow users to delete themselves.
     if ($user->id == $this->id) {
         $this->_status = KDatabase::STATUS_FAILED;
         $this->_status_message = JText::_("You can't delete yourself!");
         return false;
     }
     // Don't allow administrators to delete other administrators or super administrators.
     if ($user->gid == 24 && ($this->users_group_id == 24 || $this->users_group_id == 25)) {
         $this->setStatus(KDatabase::STATUS_FAILED);
         $this->setStatusMessage(JText::_("You can't delete a user with this user group level. " . "Only super administrators have this ability."));
         return false;
     }
     if (!parent::delete()) {
         return false;
     }
     // Syncronize ACL.
     if ($this->_status == KDatabase::STATUS_DELETED) {
         $aro = $this->getService('com://admin/groups.database.table.aros')->select(array('value' => $this->id), KDatabase::FETCH_ROW);
         $aro->delete();
         $this->getService('com://admin/groups.database.table.arosgroups')->select(array('aro_id' => $aro->id), KDatabase::FETCH_ROW)->delete();
     }
     return true;
 }