本文整理汇总了PHP中yii\db\ActiveRecord::beforeDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveRecord::beforeDelete方法的具体用法?PHP ActiveRecord::beforeDelete怎么用?PHP ActiveRecord::beforeDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\db\ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::beforeDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeDelete
public function beforeDelete()
{
if ($this->is_system) {
return false;
}
return parent::beforeDelete();
}
示例2: beforeDelete
/**
* @inheritdoc
*/
public function beforeDelete()
{
if (parent::beforeDelete()) {
FileHelper::removeDirectory(Yii::$app->file->dir . '/' . $this->id . '/');
return true;
}
return false;
}
示例3: beforeDelete
public function beforeDelete()
{
foreach ($this->getUploads() as $file) {
$file->delete();
}
return parent::beforeDelete();
}
示例4: beforeDelete
public function beforeDelete()
{
if (!empty($this->image->id)) {
$this->image->delete();
}
return parent::beforeDelete();
}
示例5: beforeDelete
public function beforeDelete()
{
if (file_exists($this->urlPath)) {
unlink($this->urlPath);
}
return parent::beforeDelete();
}
示例6: beforeDelete
public function beforeDelete()
{
if (parent::beforeDelete()) {
return unlink($this->filePath . '/' . $this->fileName);
}
return false;
}
示例7: beforeDelete
public function beforeDelete()
{
foreach ($this->attachments as $attachment) {
$attachment->delete();
}
return parent::beforeDelete();
}
示例8: beforeDelete
public function beforeDelete()
{
foreach ($this->object->objectTags as $objectTag) {
$objectTag->delete();
}
return parent::beforeDelete();
}
示例9: beforeDelete
public function beforeDelete()
{
if (!$this->shift->team->event->active) {
return false;
}
return parent::beforeDelete();
}
示例10: beforeDelete
public function beforeDelete()
{
$ret = parent::beforeDelete();
// Remove field values
$this->getDb()->createCommand()->delete(TourFieldValue::tableName(), ['field_id' => $this->id])->execute();
return $ret;
}
示例11: beforeDelete
public function beforeDelete()
{
if (!parent::beforeDelete()) {
return false;
}
$this->deleteFilename = $this->filename;
return true;
}
示例12: beforeDelete
public function beforeDelete()
{
if (unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPath'] . $this->avatar) && unlink(\Yii::getAlias('@webroot') . '/' . Yii::$app->params['uploadPreviewPath'] . $this->avatar)) {
return parent::beforeDelete();
} else {
return false;
}
}
示例13: beforeDelete
public function beforeDelete()
{
$file = $this->getImagePath() . $this->file;
if (file_exists($file) && !is_dir($file)) {
unlink($file);
}
return parent::beforeDelete();
}
示例14: beforeDelete
public function beforeDelete()
{
if (parent::beforeDelete()) {
$this->deletePreview();
return TRUE;
}
return FALSE;
}
示例15: beforeDelete
public function beforeDelete()
{
if (!parent::beforeDelete()) {
return false;
}
Settings::deleteDocument();
return true;
}