111 lines
1.9 KiB
PHP
111 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Product\Entity;
|
|
|
|
class Rech
|
|
{
|
|
|
|
public $id;
|
|
|
|
public $name;
|
|
|
|
public $slug;
|
|
|
|
public $quantite;
|
|
|
|
public $prix;
|
|
|
|
public $image;
|
|
|
|
public $content;
|
|
|
|
public $createdAt;
|
|
|
|
public $updatedAt;
|
|
|
|
public $soldAt;
|
|
|
|
public $vendeurId;
|
|
|
|
public $userId;
|
|
|
|
public $antenneId;
|
|
|
|
public $strCreatedAt;
|
|
|
|
public $strUpdatedAt;
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getUserId(): ?int
|
|
{
|
|
return $this->userId;
|
|
}
|
|
|
|
/**
|
|
* @param mixed $userId
|
|
*/
|
|
public function setUserId(int $userId)
|
|
{
|
|
$this->userId = $userId;
|
|
}
|
|
|
|
|
|
public function getAntenneId(): ?int
|
|
{
|
|
return $this->antenneId;
|
|
}
|
|
|
|
public function setAntenneId(int $antenneId): void
|
|
{
|
|
$this->antenneId = $antenneId;
|
|
}
|
|
|
|
/**
|
|
* @return \DateTime|null
|
|
*/
|
|
public function getCreatedAt(): ?\DateTime
|
|
{
|
|
return $this->createdAt;
|
|
}
|
|
|
|
public function setCreatedAt($datetime)
|
|
{
|
|
if (is_string($datetime)) {
|
|
$this->createdAt = new \DateTime($datetime);
|
|
} else {
|
|
$this->createdAt = $datetime;
|
|
}
|
|
}
|
|
|
|
public function setUpdatedAt($datetime)
|
|
{
|
|
if (is_string($datetime)) {
|
|
$this->updatedAt = new \DateTime($datetime);
|
|
} else {
|
|
$this->updatedAt = $datetime;
|
|
}
|
|
}
|
|
|
|
public function setSoldAt($datetime)
|
|
{
|
|
if (is_string($datetime)) {
|
|
$this->soldAt = new \DateTime($datetime);
|
|
} else {
|
|
$this->soldAt = $datetime;
|
|
}
|
|
}
|
|
|
|
public function getThumb()
|
|
{
|
|
['filename' => $filename, 'extension' => $extension] = pathinfo($this->image);
|
|
return '/uploads/recherches/' . $filename . '_thumb.' . $extension;
|
|
}
|
|
|
|
public function getImageUrl()
|
|
{
|
|
return '/uploads/recherches/' . $this->image;
|
|
}
|
|
}
|