Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
97 | public function getByName(string $name): EmailTemplates |
||
98 | { |
||
99 | $emailTemplate = self::findFirst([ |
||
100 | 'conditions' => 'company_id = ?1 and app_id = ?2 and name = ?3 and is_deleted = 0', |
||
101 | 'bind' => [Di::getDefault()->getUserData()->default_company, Di::getDefault()->getConfig()->app->id, $name] |
||
102 | ]); |
||
103 | |||
104 | if (!is_object($emailTemplate)) { |
||
105 | throw new UnprocessableEntityHttpException((string) current($emailTemplate->getMessages())); |
||
106 | } |
||
107 | |||
108 | return $emailTemplate; |
||
109 | } |
||
111 |