本文整理汇总了PHP中CActiveRecord::beforeDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::beforeDelete方法的具体用法?PHP CActiveRecord::beforeDelete怎么用?PHP CActiveRecord::beforeDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::beforeDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeDelete
public function beforeDelete()
{
if (!empty($this->jobs)) {
return false;
}
return parent::beforeDelete();
}
示例2: beforeDelete
/**
* Before-delete hook
*
* @return type
*/
protected function beforeDelete()
{
if (!$this->canBeDeleted) {
return false;
}
return parent::beforeDelete();
}
示例3: beforeDelete
public function beforeDelete()
{
$item = InventoryItems::model()->findByPk($this->item_id);
$item->qty += $this->qty;
$item->save();
return parent::beforeDelete();
}
示例4: beforeDelete
/**
* Make sure we delete any comments
*/
public function beforeDelete()
{
foreach ($this->comments as $comment) {
$comment->delete();
}
return parent::beforeDelete();
}
示例5: beforeDelete
/**
*
**/
protected function beforeDelete()
{
if (parent::beforeDelete()) {
unlink(Yii::app()->params->imageBasePath . DIRECTORY_SEPARATOR . $this->filename);
}
return true;
}
示例6: beforeDelete
protected function beforeDelete()
{
foreach ($this->candidates() as $candidate) {
$candidate->delete();
}
return parent::beforeDelete();
}
示例7: beforeDelete
public function beforeDelete()
{
parent::beforeDelete();
foreach ($this->points as $point) {
$point->delete();
}
return true;
}
示例8: beforeDelete
protected function beforeDelete()
{
if (parent::beforeDelete()) {
if ($this->demo_real && @unlink(Yii::getPathOfAlias('webroot.include.files') . DIRECTORY_SEPARATOR . $this->demo_file)) {
return true;
}
}
return false;
}
示例9: beforeDelete
public function beforeDelete()
{
$this->cacheId = $this->attribute_group_id;
// delete relations
foreach ($this->attributes as $attribute) {
$attribute->delete();
}
return parent::beforeDelete();
}
示例10: beforeDelete
protected function beforeDelete()
{
foreach ($this->seats() as $seat) {
$seat->delete();
}
foreach ($this->tokens() as $token) {
$token->delete();
}
return parent::beforeDelete();
}
示例11: beforeDelete
/**
* Make sure we delete any posts
*/
public function beforeDelete()
{
foreach ($this->posts as $post) {
$post->delete();
}
foreach ($this->subs as $sub) {
$sub->delete();
}
return parent::beforeDelete();
}
示例12: beforeDelete
protected function beforeDelete()
{
$result = parent::beforeDelete();
if (!$result) {
return false;
}
if ($this->album && $this->album->isCover($this)) {
$this->coverShouldBeUpdated = true;
}
return $result;
}
示例13: beforeDelete
protected function beforeDelete()
{
if (parent::beforeDelete()) {
foreach ($this->catalogProducts as $product) {
$product->delete();
}
return true;
} else {
return false;
}
}
示例14: beforeDelete
public function beforeDelete()
{
/* remove all nodes attached to this mindmap */
$sql = strtr('DELETE FROM {table} WHERE mindmap_id=:mindmap_id', array('{table}' => Node::model()->tableName()));
try {
Yii::app()->db->createCommand($sql)->bindValue(':mindmap_id', $this->id)->execute();
} catch (Exception $e) {
echo $e->getMessage();
}
return parent::beforeDelete();
}
示例15: beforeDelete
/**
* Custom actions before deleting a record
* @return boolean
*/
protected function beforeDelete()
{
if (parent::beforeDelete()) {
if ($childs = $this->childs) {
foreach ($childs as $child) {
$child->delete();
}
}
return true;
}
return false;
}