<?php declare(strict_types=1);
namespace Nds\RecipeManager\Core\Content\Recipe;
use Nds\RecipeManager\Core\Content\Recipe\RecipeMedia\RecipeMediaCollection;
use Shopware\Core\Content\Media\MediaEntity;
use Nds\RecipeManager\Core\Content\Tag\TagCollection;
use Shopware\Core\Framework\DataAbstractionLayer\Entity;
use Nds\RecipeManager\Core\Content\Related\RelatedCollection;
use Nds\RecipeManager\Core\Content\Category\CategoryCollection;
use Nds\RecipeManager\Core\Content\Difficulty\DifficultyEntity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityIdTrait;
use Nds\RecipeManager\Core\Content\Ingredient\IngredientCollection;
use Nds\RecipeManager\Core\Content\Recipe\RecipeMedia\RecipeMediaEntity;
use Shopware\Core\Framework\DataAbstractionLayer\EntityCustomFieldsTrait;
use Nds\RecipeManager\Core\Content\Recipe\Aggregate\RecipeTranslation\RecipeTranslationCollection;
class RecipeEntity extends Entity
{
use EntityIdTrait;
use EntityCustomFieldsTrait;
/**
* @var string
*/
protected $name;
/**
* @var string|null
*/
protected $subhead;
/**
* @var string|null
*/
protected $description;
/**
* @var string|null
*/
protected $preparation;
/**
* @var string|null
*/
protected $metaTitle;
/**
* @var string|null
*/
protected $metaDescription;
/**
* @var string
*/
protected $slug;
/**
* @var string|null
*/
protected $preparationTime;
/**
* @var float|null
*/
protected $energy;
/**
* @var float|null
*/
protected $calories;
/**
* @var float|null
*/
protected $protein;
/**
* @var float|null
*/
protected $carbohydrates;
/**
* @var float|null
*/
protected $fat;
/**
* @var string|null
*/
protected $robots;
/**
* @var bool|null
*/
protected $active;
/**
* @var bool
*/
protected $portionCalculatorActive;
/**
* @var int|null
*/
protected $portionQuantity;
/**
* @var CategoryCollection|null
*/
protected $categories;
/**
* @var TagCollection|null
*/
protected $tags;
/**
* @var IngredientCollection|null
*/
protected $ingredients;
/**
* @var RecipeMediaCollection|null
*/
protected $media;
/**
* @var string|null
*/
protected $coverId;
/**
* @var MediaEntity|null
*/
protected $cover;
/**
* @var string
*/
protected $difficultyId;
/**
* @var DifficultyEntity|null
*/
protected $difficulty;
/**
* @var RelatedCollection|null
*/
protected $relatedRecipes;
/**
* @var RecipeTranslationCollection|null
*/
protected $translations;
/**
* @var \DateTimeInterface|null
*/
protected $createdAt;
/**
* @var \DateTimeInterface|null
*/
protected $updatedAt;
public function getName(): string
{
return $this->name;
}
public function setName(string $name): void
{
$this->name = $name;
}
public function getSubhead(): ?string
{
return $this->subhead;
}
public function setSubhead(?string $subhead): void
{
$this->subhead = $subhead;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): void
{
$this->description = $description;
}
public function getPreparation(): ?string
{
return $this->preparation;
}
public function setPreparation(?string $preparation): void
{
$this->preparation = $preparation;
}
public function getMetaTitle(): ?string
{
return $this->metaTitle;
}
public function setMetaTitle(?string $metaTitle): void
{
$this->metaTitle = $metaTitle;
}
public function getMetaDescription(): ?string
{
return $this->metaDescription;
}
public function setMetaDescription(?string $metaDescription): void
{
$this->metaDescription = $metaDescription;
}
public function getSlug(): string
{
return $this->slug;
}
public function setSlug(string $slug): void
{
$this->slug = $slug;
}
public function getPreparationTime(): ?string
{
return $this->preparationTime;
}
public function setPreparationTime(string $preparationTime): void
{
$this->preparationTime = $preparationTime;
}
public function getEnergy(): ?float
{
return $this->energy;
}
public function setEnergy(?float $energy): void
{
$this->energy = $energy;
}
public function getCalories(): ?float
{
return $this->calories;
}
public function setCalories(?float $calories): void
{
$this->calories = $calories;
}
public function getProtein(): ?float
{
return $this->protein;
}
public function setProtein(?float $protein): void
{
$this->protein = $protein;
}
public function getCarbohydrates(): ?float
{
return $this->carbohydrates;
}
public function setCarbohydrates(?float $carbohydrates): void
{
$this->carbohydrates = $carbohydrates;
}
public function getFat(): ?float
{
return $this->fat;
}
public function setFat(?float $fat): void
{
$this->fat = $fat;
}
public function getRobots(): ?string
{
return $this->robots;
}
public function setRobots(?string $robots): void
{
$this->robots = $robots;
}
public function getActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): void
{
$this->active = $active;
}
public function isPortionCalculatorActive(): bool
{
return $this->portionCalculatorActive;
}
public function setPortionCalculatorActive(bool $portionCalculatorActive): void
{
$this->portionCalculatorActive = $portionCalculatorActive;
}
public function getPortionQuantity(): ?int
{
return $this->portionQuantity;
}
public function setPortionQuantity(?int $portionQuantity): void
{
$this->portionQuantity = $portionQuantity;
}
public function getCategories(): ?CategoryCollection
{
return $this->categories;
}
public function setCategories(CategoryCollection $categories): void
{
$this->categories = $categories;
}
public function getTags(): ?TagCollection
{
return $this->tags;
}
public function setTags(TagCollection $tags): void
{
$this->tags = $tags;
}
public function getIngredients(): ?IngredientCollection
{
return $this->ingredients;
}
public function setIngredients(IngredientCollection $ingredients): void
{
$this->ingredients = $ingredients;
}
public function getMedia(): ?RecipeMediaCollection
{
return $this->media;
}
public function setMedia(?RecipeMediaCollection $media): void
{
$this->media = $media;
}
public function getCoverId(): ?string
{
return $this->coverId;
}
public function setcoverId(?string $coverId): void
{
$this->coverId = $coverId;
}
public function getCover(): ?MediaEntity
{
return $this->cover;
}
public function setCover(?MediaEntity $cover): void
{
$this->cover = $cover;
}
public function getDifficultyId(): string
{
return $this->difficultyId;
}
public function setDifficultyId(string $difficultyId): void
{
$this->difficultyId = $difficultyId;
}
public function getDifficulty(): ?DifficultyEntity
{
return $this->difficulty;
}
public function setDifficulty(DifficultyEntity $difficulty): void
{
$this->difficulty = $difficulty;
}
public function getRelatedRecipes(): ?RelatedCollection
{
return $this->relatedRecipes;
}
public function setRelatedRecipes(RelatedCollection $relatedRecipes): void
{
$this->relatedRecipes = $relatedRecipes;
}
public function getTranslations(): ?RecipeTranslationCollection
{
return $this->translations;
}
public function setTranslations(RecipeTranslationCollection $translations): void
{
$this->translations = $translations;
}
public function getCreatedAt(): \DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): void
{
$this->createdAt = $createdAt;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
public function hasNutritionalValues(): bool
{
return $this->energy !== null || $this->calories !== null || $this->protein !== null || $this->fat !== null || $this->carbohydrates !== null;
}
public function hasTags(): bool
{
return \count($this->tags) > 0;
}
public function hasRelatedRecipes(): bool
{
return \count($this->relatedRecipes) > 0;
}
}