bebeboutik-api/app/Models/Product/ProductList.php
Christophe LATOUR dbe268c561 Handling images
2017-08-14 12:39:19 +02:00

21 lines
477 B
PHP

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