20 lines
444 B
PHP
Raw Normal View History

2017-08-11 16:10:27 +02:00
<?php
namespace App\Models;
use Antadis\API\Front\Models\Sale as BaseSale;
2017-08-14 12:39:19 +02:00
use App\Classes\ImageTrait;
2017-08-11 16:10:27 +02:00
class Sale extends BaseSale {
2017-08-14 12:39:19 +02:00
use ImageTrait;
2017-08-11 16:10:27 +02:00
/**
* {@inheritdoc}
*/
public function toArray() {
$sale = parent::toArray();
2017-08-14 12:39:19 +02:00
$is_active = strtotime($this->date_start) < strtotime(date('Y-m-d 07:00:00'));
$sale['img'] = $this->getSaleImage($this->id, $is_active);
2017-08-11 16:10:27 +02:00
return $sale;
}
}