本文整理匯總了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;
}