2014-06-06 21:38:34 +10:00
|
|
|
<?php namespace System\Models;
|
|
|
|
|
|
|
|
use Model;
|
|
|
|
use System\Classes\ApplicationException;
|
|
|
|
|
2014-07-04 18:47:46 +10:00
|
|
|
class MailLayout extends Model
|
2014-06-06 21:38:34 +10:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string The database table used by the model.
|
|
|
|
*/
|
2014-07-04 18:47:46 +10:00
|
|
|
protected $table = 'system_mail_layouts';
|
2014-06-06 21:38:34 +10:00
|
|
|
|
|
|
|
public $rules = [
|
2014-07-04 18:47:46 +10:00
|
|
|
'code' => 'required|unique:system_mail_layouts',
|
2014-06-06 21:38:34 +10:00
|
|
|
'name' => 'required',
|
|
|
|
'content_html' => 'required',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function beforeDelete()
|
|
|
|
{
|
|
|
|
if ($this->is_locked)
|
|
|
|
throw new ApplicationException('Cannot delete this template because it is locked');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|