| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public static function mapEntity(EntityMapperInterface $mapper): void |
||
| 23 | { |
||
| 24 | $mapper->useTimestamp(); |
||
| 25 | $mapper->casts([ |
||
| 26 | 'created_at' => 'date', |
||
| 27 | 'updated_at' => '?date', |
||
| 28 | ]); |
||
| 29 | |||
| 30 | $mapper->relation('category')->belongsTo(ProductCategory::class); |
||
| 31 | |||
| 32 | $mapper->filter('category', function (Query $q, $value) { |
||
| 33 | $q->where('product_category_id')->is($value); |
||
| 34 | }); |
||
| 37 |