mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-24 14:56:13 +01:00
f0127b3b64
Co-authored-by: Łukasz Uznański <l.uznanski@macopedia.com>
69 lines
1.5 KiB
PHP
69 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace TTN\Tea\Domain\Model\Product;
|
|
|
|
use TYPO3\CMS\Extbase\Annotation\ORM\Lazy;
|
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
|
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
|
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
|
|
|
|
/**
|
|
* This class represents a tea (flavor), e.g., "Earl Grey".
|
|
*/
|
|
class Tea extends AbstractEntity
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $title = '';
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $description = '';
|
|
|
|
/**
|
|
* @phpstan-var \TYPO3\CMS\Extbase\Domain\Model\FileReference|LazyLoadingProxy|null
|
|
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference|null
|
|
* @Lazy
|
|
*/
|
|
protected $image;
|
|
|
|
public function getTitle(): string
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function setTitle(string $title): void
|
|
{
|
|
$this->title = $title;
|
|
}
|
|
|
|
public function getDescription(): string
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
public function setDescription(string $description): void
|
|
{
|
|
$this->description = $description;
|
|
}
|
|
|
|
public function getImage(): ?FileReference
|
|
{
|
|
if ($this->image instanceof LazyLoadingProxy) {
|
|
/** @var FileReference $image */
|
|
$image = $this->image->_loadRealInstance();
|
|
$this->image = $image;
|
|
}
|
|
|
|
return $this->image;
|
|
}
|
|
|
|
public function setImage(FileReference $image): void
|
|
{
|
|
$this->image = $image;
|
|
}
|
|
}
|