bakaphp /
phalcon-api
| 1 | <?php |
||||
| 2 | declare(strict_types=1); |
||||
| 3 | |||||
| 4 | namespace Gewaer\Models; |
||||
| 5 | |||||
| 6 | class EmailTemplates extends AbstractModel |
||||
| 7 | { |
||||
| 8 | /** |
||||
| 9 | * |
||||
| 10 | * @var integer |
||||
| 11 | */ |
||||
| 12 | public $id; |
||||
| 13 | |||||
| 14 | /** |
||||
| 15 | * |
||||
| 16 | * @var string |
||||
| 17 | */ |
||||
| 18 | public $company_id; |
||||
| 19 | |||||
| 20 | /** |
||||
| 21 | * |
||||
| 22 | * @var integer |
||||
| 23 | */ |
||||
| 24 | public $app_id; |
||||
| 25 | |||||
| 26 | /** |
||||
| 27 | * |
||||
| 28 | * @var integer |
||||
| 29 | */ |
||||
| 30 | public $name; |
||||
| 31 | |||||
| 32 | /** |
||||
| 33 | * |
||||
| 34 | * @var integer |
||||
| 35 | */ |
||||
| 36 | public $template; |
||||
| 37 | |||||
| 38 | /** |
||||
| 39 | * |
||||
| 40 | * @var string |
||||
| 41 | */ |
||||
| 42 | public $users_id; |
||||
| 43 | |||||
| 44 | /** |
||||
| 45 | * |
||||
| 46 | * @var integer |
||||
| 47 | */ |
||||
| 48 | public $is_deleted; |
||||
| 49 | |||||
| 50 | /** |
||||
| 51 | * |
||||
| 52 | * @var string |
||||
| 53 | */ |
||||
| 54 | public $created_at; |
||||
| 55 | |||||
| 56 | /** |
||||
| 57 | * |
||||
| 58 | * @var string |
||||
| 59 | */ |
||||
| 60 | public $updated_at; |
||||
| 61 | |||||
| 62 | /** |
||||
| 63 | * Initialize method for model. |
||||
| 64 | */ |
||||
| 65 | 2 | public function initialize() |
|||
| 66 | { |
||||
| 67 | 2 | $this->setSource('email_templates'); |
|||
| 68 | 2 | } |
|||
| 69 | |||||
| 70 | /** |
||||
| 71 | * Returns table name mapped in the model. |
||||
| 72 | * |
||||
| 73 | * @return string |
||||
| 74 | */ |
||||
| 75 | 2 | public function getSource(): string |
|||
| 76 | { |
||||
| 77 | 2 | return 'email_templates'; |
|||
| 78 | } |
||||
| 79 | |||||
| 80 | /** |
||||
| 81 | * Retrieve email template by name |
||||
| 82 | * @param $name |
||||
| 83 | * @return EmailTemplates |
||||
| 84 | */ |
||||
| 85 | public function getByName(string $name): EmailTemplates |
||||
| 86 | { |
||||
| 87 | $emailTemplate = self::findFirst([ |
||||
| 88 | 'conditions' => 'users_id = ?0 and company_id = ?1 and app_id = ?2 and name = ?3 and is_deleted = 0', |
||||
| 89 | 'bind' => [$this->di->getUserData()->getId(), $this->di->getUserData()->defaulCompany->getId(), $this->di->getApp()->getId(), $name] |
||||
|
0 ignored issues
–
show
The property
di does not exist on Gewaer\Models\EmailTemplates. Since you implemented __get, consider adding a @property annotation.
Loading history...
The method
getUserData() does not exist on Phalcon\Mvc\Model\Resultset.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||
| 90 | ]); |
||||
| 91 | |||||
| 92 | if (!$emailTemplate) { |
||||
|
0 ignored issues
–
show
|
|||||
| 93 | throw new UnprocessableEntityHttpException((string) current($emailTemplate->getMessages())); |
||||
|
0 ignored issues
–
show
The type
Gewaer\Models\UnprocessableEntityHttpException was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 94 | } |
||||
| 95 | |||||
| 96 | return $emailTemplate; |
||||
|
1 ignored issue
–
show
|
|||||
| 97 | } |
||||
| 98 | } |
||||
| 99 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.