/** * Удаляет учетную запись * @return */ public function delete() { $data = UsersDBManager::get($this->id->getValue()); if (!empty($data['persistent'])) { return; } $granted = EventController::callFilter('users_account_before_delete', $this); // if granted then call standart removing if (!empty($granted)) { parent::delete($granted); } else { return; } EventController::callEvent('users_account_after_delete', $this); }
/** * (non-PHPdoc) * @see parent::delete() */ public function delete() { // store current id $id = $this->getId(); if ($this->withSitemap) { try { $this->needSitemapData(); // Вызываем удаление $aChild = Sitemap_Sample::selectChild($this->sitemapInfo['id']); foreach ($aChild as $row) { Sitemap::remove($row['id']); } } catch (SiteMapException $e) { } } $result = parent::delete(); if ($this->withSitemap) { try { Sitemap::remove($this->sitemapInfo['id']); } catch (SitemapException $e) { } } // Удаляем данные return $result; }