Issues (413)

app/Transformers/ProductModelTransformer.php (5 issues)

1
<?php
2
3
namespace Yeelight\Transformers;
4
5
use Yeelight\Models\ProductModel;
6
7
/**
8
 * Class ProductModelTransformer
9
 *
10
 * @category Yeelight
11
 *
12
 * @package Yeelight\Transformers
13
 *
14
 * @author Sheldon Lee <[email protected]>
15
 *
16
 * @license https://opensource.org/licenses/MIT MIT
17
 *
18
 * @link https://www.yeelight.com
19
 */
20
class ProductModelTransformer extends BaseTransformer
21
{
22
    /**
23
     * Transform the ProductModel entity.
24
     *
25
     * @param ProductModel $model
26
     *
27
     * @return array
28
     */
29
    public function transform(ProductModel $model)
30
    {
31
        return [
32
            'product_model_id' => (int) $model->product_model_id,
0 ignored issues
show
Bug Best Practice introduced by
The property product_model_id does not exist on Yeelight\Models\ProductModel. Since you implemented __get, consider adding a @property annotation.
Loading history...
33
34
            'title'      => (string) $model->title,
0 ignored issues
show
Bug Best Practice introduced by
The property title does not exist on Yeelight\Models\ProductModel. Since you implemented __get, consider adding a @property annotation.
Loading history...
35
            'model_name' => (string) $model->model_name,
0 ignored issues
show
Bug Best Practice introduced by
The property model_name does not exist on Yeelight\Models\ProductModel. Since you implemented __get, consider adding a @property annotation.
Loading history...
36
            'code'       => (string) $model->code,
0 ignored issues
show
Bug Best Practice introduced by
The property code does not exist on Yeelight\Models\ProductModel. Since you implemented __get, consider adding a @property annotation.
Loading history...
37
            'status'     => (int) $model->status,
0 ignored issues
show
Bug Best Practice introduced by
The property status does not exist on Yeelight\Models\ProductModel. Since you implemented __get, consider adding a @property annotation.
Loading history...
38
39
            'created_by' => (string) $model->created_by,
40
            'created_at' => (string) $model->created_at,
41
            'created_ip' => (string) $model->created_ip,
42
            'updated_by' => (string) $model->updated_by,
43
            'updated_at' => (string) $model->updated_at,
44
            'updated_ip' => (string) $model->updated_ip,
45
        ];
46
    }
47
}
48