bebeboutik-api/app/Models/Product/ProductList.php

21 lines
477 B
PHP
Raw Normal View History

2017-08-11 17:31:39 +02:00
<?php
namespace App\Models\Product;
use Antadis\API\Front\Models\Product\ProductList as BaseProduct;
2017-08-14 12:39:19 +02:00
use App\Classes\ImageTrait;
2017-08-11 17:31:39 +02:00
class ProductList extends BaseProduct {
2017-08-14 12:39:19 +02:00
use ImageTrait;
2017-08-11 17:31:39 +02:00
/**
* {@inheritdoc}
*/
public function toArray() {
$product = parent::toArray();
2017-08-14 12:39:19 +02:00
$image = $this->getCover($this->id);
$product['img'] = $this->getProductImage($image['id_image'], $this->link_rewrite, 'home');
2017-08-11 17:31:39 +02:00
return $product;
}
}