1 | <?php |
||
2 | namespace App\Factory; |
||
3 | |||
4 | use App\Model\ArticleMeta; |
||
5 | use Yii; |
||
6 | |||
7 | class ArticleMetaFactory |
||
8 | { |
||
9 | public static function findByArticleId(int $articleId): ?ArticleMeta |
||
10 | { |
||
11 | return ArticleMeta::findOne([ |
||
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
12 | 'article_id' => $articleId, |
||
13 | ]); |
||
14 | } |
||
15 | |||
16 | 2 | public static function create(int $articleId, string $content): ArticleMeta |
|
17 | { |
||
18 | 2 | return new ArticleMeta([ |
|
19 | 2 | 'article_id' => $articleId, |
|
20 | 2 | 'content' => $content, |
|
21 | ]); |
||
22 | } |
||
23 | } |
||
24 |