You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
634 B

<?php
namespace tests\models;
class ProjectLink extends \yii\db\ActiveRecord
{
public $blockDelete = false;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'project_link';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['language', 'name', 'project_id'], 'required'],
[['language', 'name'], 'unique']
];
}
public function beforeDelete()
{
if ($this->blockDelete === true) {
return false;
} else {
return parent::beforeDelete();
}
}
}