winter/modules/system/models/MailLayout.php
Sam Georges 3617a7fea8 Important! All references to *Email* have been changed to *Mail*
(This change might hurt a little, sorry!)
2014-07-04 19:14:15 +10:00

25 lines
611 B
PHP

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