2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-12-07 12:13:32 +01:00
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-12-01 12:16:06 +01:00
|
|
|
namespace TTN\Tea\Domain\Model\Product;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2019-08-12 17:43:02 +02:00
|
|
|
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
|
2018-05-25 22:39:33 +02:00
|
|
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
2018-05-25 16:19:12 +02:00
|
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
2018-05-25 22:39:33 +02:00
|
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
|
2018-05-25 16:19:12 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This class represents a tea (flavor), e.g., "Earl Grey".
|
|
|
|
*/
|
|
|
|
class Tea extends AbstractEntity
|
|
|
|
{
|
2022-10-03 19:00:55 +02:00
|
|
|
protected string $title = '';
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2022-10-03 19:00:55 +02:00
|
|
|
protected string $description = '';
|
2018-05-25 16:19:12 +02:00
|
|
|
|
2018-05-25 22:39:33 +02:00
|
|
|
/**
|
2021-09-22 22:34:58 +02:00
|
|
|
* @phpstan-var \TYPO3\CMS\Extbase\Domain\Model\FileReference|LazyLoadingProxy|null
|
|
|
|
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference|null
|
2019-08-12 16:23:28 +02:00
|
|
|
* @Lazy
|
2018-05-25 22:39:33 +02:00
|
|
|
*/
|
2021-11-17 13:14:43 +01:00
|
|
|
protected $image;
|
2018-05-25 22:39:33 +02:00
|
|
|
|
2018-05-25 16:19:12 +02:00
|
|
|
public function getTitle(): string
|
|
|
|
{
|
|
|
|
return $this->title;
|
|
|
|
}
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setTitle(string $title): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
$this->title = $title;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getDescription(): string
|
|
|
|
{
|
|
|
|
return $this->description;
|
|
|
|
}
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setDescription(string $description): void
|
2018-05-25 16:19:12 +02:00
|
|
|
{
|
|
|
|
$this->description = $description;
|
|
|
|
}
|
2018-05-25 22:39:33 +02:00
|
|
|
|
2019-08-12 17:43:02 +02:00
|
|
|
public function getImage(): ?FileReference
|
2018-05-25 22:39:33 +02:00
|
|
|
{
|
|
|
|
if ($this->image instanceof LazyLoadingProxy) {
|
2021-09-22 22:34:58 +02:00
|
|
|
/** @var FileReference $image */
|
|
|
|
$image = $this->image->_loadRealInstance();
|
|
|
|
$this->image = $image;
|
2018-05-25 22:39:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return $this->image;
|
|
|
|
}
|
|
|
|
|
2019-08-12 17:25:59 +02:00
|
|
|
public function setImage(FileReference $image): void
|
2018-05-25 22:39:33 +02:00
|
|
|
{
|
|
|
|
$this->image = $image;
|
|
|
|
}
|
2018-05-25 16:19:12 +02:00
|
|
|
}
|