本文整理汇总了PHP中CActiveRecord::afterDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::afterDelete方法的具体用法?PHP CActiveRecord::afterDelete怎么用?PHP CActiveRecord::afterDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::afterDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterDelete
/**
* @return void
*/
public function afterDelete()
{
// remove Entry relations
EntryHasTag::model()->deleteAllByAttributes(array('tagId' => $this->id));
parent::afterDelete();
}
示例2: afterDelete
public function afterDelete()
{
if (!$this->orig_id) {
Yii::app()->db->createCommand("DELETE FROM bookmarks WHERE user_id = :user_id AND book_id = :book_id AND orig_id IS NOT NULL")->execute(array(":user_id" => $this->user_id, ":book_id" => $this->book_id));
}
parent::afterDelete();
}
示例3: afterDelete
protected function afterDelete()
{
parent::afterDelete();
Authassignment::model()->deleteAll("itemname='" . $this->name . "'");
Authitemchild::model()->deleteAll("parent='" . $this->name . "'");
Authitemchild::model()->deleteAll("child='" . $this->name . "'");
}
示例4: afterDelete
protected function afterDelete()
{
parent::afterDelete();
if ($this->image) {
$this->image->delete();
}
}
示例5: afterDelete
public function afterDelete()
{
// delete dependencies
ManufacturerToStore::model()->deleteAll("manufacturer_id={$this->cacheId}");
UrlAlias::model()->deleteAll("query='manufacturer_id={$this->cacheId}'");
parent::afterDelete();
}
示例6: afterDelete
protected function afterDelete()
{
parent::afterDelete();
@unlink(Helper::mediaPath(Product::UPLOAD_ORIGINAL_IMAGE_PATH . $this->image_path, FRONTEND));
@unlink(Helper::mediaPath(Product::UPLOAD_LARGE_IMAGE_PATH . $this->image_path, FRONTEND));
@unlink(Helper::mediaPath(Product::UPLOAD_THUMBNAIL_IMAGE_PATH . $this->image_path, FRONTEND));
}
示例7: afterDelete
protected function afterDelete()
{
foreach ($this->networks as $nw) {
$nw->delete();
}
parent::afterDelete();
}
示例8: afterDelete
public function afterDelete()
{
if ($this->fileName && is_file($this->getFilePath())) {
unlink($this->getFilePath());
}
parent::afterDelete();
}
示例9: afterDelete
public function afterDelete()
{
parent::afterDelete();
if ($this->countByAttributes(['event_id' => $this->event_id]) == 0) {
Events::model()->deleteByPk($this->event_id);
}
}
示例10: afterDelete
/**
* This is invoked after the record is deleted.
*/
protected function afterDelete()
{
parent::afterDelete();
$this->value->delete();
Photo::deleteByProduct($this);
ProductRelation::model()->deleteAll('pid=' . $this->id . ' OR pr_id=' . $this->id);
CatalogRelation::model()->deleteAll('pr_id=' . $this->id);
}
示例11: afterDelete
protected function afterDelete()
{
parent::afterDelete();
$file = Yii::getPathOfAlias('webroot') . '/uploads/' . $this->id . '/' . $this->img;
if (file_exists($file) && !is_dir($file)) {
unlink($file);
}
}
示例12: afterDelete
public function afterDelete()
{
parent::afterDelete();
$this->book->n_chapters--;
$this->book->n_verses -= $this->n_verses;
$this->book->n_vars -= $this->n_vars;
$this->book->d_vars -= $this->d_vars;
$this->book->save(false, array("n_chapters", "n_verses", "n_vars", "d_vars"));
}
示例13: afterDelete
protected function afterDelete()
{
if (parent::afterDelete()) {
$model = EvaQuestionGroups::model('section=:section', [':section' => 'econEvaMethods']);
$model->method = $this->id;
$model->setScenario('delete');
$model->save();
}
}
示例14: afterDelete
public function afterDelete()
{
parent::afterDelete();
$id = $this->id_usr;
// delete history
Yii::app()->db->createCommand("DELETE FROM user_lists_usl WHERE idusr_usl={$id}")->execute();
Yii::app()->db->createCommand("DELETE FROM user_files_usf WHERE idusr_usf={$id}")->execute();
Yii::app()->db->createCommand("DELETE FROM permanent_statistics_user_psu WHERE idusr_psu={$id}")->execute();
Yii::app()->db->createCommand("DELETE FROM external_users_history_euh WHERE idusr_euh={$id}")->execute();
}
示例15: afterDelete
public function afterDelete()
{
$qrs = $this->qrs;
if ($qrs) {
foreach ($qrs as $qr) {
$qr->delete();
}
}
return parent::afterDelete();
}