2018-05-25 16:19:12 +02:00
|
|
|
<?php
|
2019-08-12 17:25:59 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-05-25 16:19:12 +02:00
|
|
|
namespace OliverKlee\Tea\Domain\Model\Product;
|
|
|
|
|
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".
|
|
|
|
*
|
|
|
|
* @author Oliver Klee <typo3-coding@oliverklee.de
|
|
|
|
*/
|
|
|
|
class Tea extends AbstractEntity
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $title = '';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $description = '';
|
|
|
|
|
2018-05-25 22:39:33 +02:00
|
|
|
/**
|
|
|
|
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
2019-08-12 16:23:28 +02:00
|
|
|
* @Lazy
|
2018-05-25 22:39:33 +02:00
|
|
|
*/
|
|
|
|
protected $image = null;
|
|
|
|
|
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) {
|
|
|
|
$this->image = $this->image->_loadRealInstance();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|