983 lines
18 KiB
PHP
Executable File
983 lines
18 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Evomedien\Vitec\Domain\Model;
|
|
|
|
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
|
|
use TYPO3\CMS\Extbase\Domain\Model\Category;
|
|
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
|
|
|
|
|
|
|
|
/**
|
|
* This file is part of the "VITEC" Extension for TYPO3 CMS.
|
|
*
|
|
* For the full copyright and license information, please read the
|
|
* LICENSE.txt file that was distributed with this source code.
|
|
*
|
|
* (c) 2025
|
|
*/
|
|
|
|
/**
|
|
* Product
|
|
*/
|
|
class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
|
{
|
|
|
|
/**
|
|
* title
|
|
*
|
|
* @var string
|
|
* @TYPO3\CMS\Extbase\Annotation\Validate("NotEmpty")
|
|
*/
|
|
protected $title;
|
|
|
|
/**
|
|
* slug
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $slug;
|
|
|
|
/**
|
|
* urltitle
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $urltitle = '';
|
|
|
|
/**
|
|
* seotitle
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $seotitle = '';
|
|
|
|
/**
|
|
* seometa
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $seometa = '';
|
|
|
|
/**
|
|
* keywords
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $keywords = '';
|
|
|
|
/**
|
|
* structureddata
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $structureddata = '';
|
|
|
|
/**
|
|
* teaser
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $teaser = '';
|
|
|
|
/**
|
|
* subtitle
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $subtitle = '';
|
|
|
|
/**
|
|
* video
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $video = '';
|
|
|
|
/**
|
|
* hideonapp
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $hideonapp = false;
|
|
|
|
/**
|
|
* hideonwebsite
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $hideonwebsite = false;
|
|
|
|
/**
|
|
* hideondatasheets
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $hideondatasheets = false;
|
|
|
|
/**
|
|
* hideonproducts
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $hideonproducts = false;
|
|
|
|
/**
|
|
* applications
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $applications = '';
|
|
|
|
/**
|
|
* description
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = '';
|
|
|
|
|
|
/**
|
|
* highlights
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $highlights = '';
|
|
|
|
/**
|
|
* shortcut
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $shortcut = false;
|
|
|
|
/**
|
|
* shortcutpid
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $shortcutpid = '';
|
|
|
|
/**
|
|
* legacy
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $legacy = false;
|
|
|
|
/**
|
|
* supportproduct
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $supportproduct = false;
|
|
|
|
/**
|
|
* subproduct
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $subproduct = false;
|
|
|
|
/**
|
|
* @var ObjectStorage<Category>
|
|
*/
|
|
protected $categories;
|
|
|
|
/**
|
|
* Product images
|
|
*
|
|
* @var ObjectStorage<FileReference>
|
|
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
|
|
*/
|
|
protected $productimage;
|
|
|
|
/**
|
|
* Downloads
|
|
*
|
|
* @var ObjectStorage<\Evomedien\Vitec\Domain\Model\Download>
|
|
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
|
|
*/
|
|
protected $downloads;
|
|
|
|
|
|
/**
|
|
* Open Graph Image
|
|
*
|
|
* @var FileReference
|
|
*/
|
|
protected $ogimage;
|
|
|
|
/**
|
|
* Content element link - Key Features
|
|
*
|
|
* @var string
|
|
*/
|
|
|
|
/**
|
|
* Uploaded / locally selected video file (FAL)
|
|
*
|
|
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference|null
|
|
*/
|
|
protected $videofile;
|
|
|
|
|
|
/**
|
|
* Show the "Datapath is now Vitec" graphic in the frontend
|
|
*
|
|
* @var bool
|
|
*/
|
|
protected $showdatapath = false;
|
|
|
|
protected $contentelement;
|
|
|
|
/**
|
|
* Content element link - CTA Features
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $contentelementcta;
|
|
|
|
/**
|
|
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Evomedien\Vitec\Domain\Model\Product>
|
|
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
|
|
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
|
|
*/
|
|
protected $relatedprodukt;
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
/**
|
|
* Returns the title
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getTitle()
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
/**
|
|
* Sets the title
|
|
*
|
|
* @param string $title
|
|
* @return void
|
|
*/
|
|
public function setTitle(string $title)
|
|
{
|
|
$this->title = $title;
|
|
}
|
|
|
|
/**
|
|
* Returns the video
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getVideo()
|
|
{
|
|
return $this->video;
|
|
}
|
|
|
|
/**
|
|
* Sets the video
|
|
*
|
|
* @param string $video
|
|
* @return void
|
|
*/
|
|
public function setVideo(string $video)
|
|
{
|
|
$this->video = $video;
|
|
}
|
|
|
|
/**
|
|
* Returns the slug
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getSlug()
|
|
{
|
|
return $this->slug;
|
|
}
|
|
|
|
/**
|
|
* Sets the slug
|
|
*
|
|
* @param string $slug
|
|
* @return void
|
|
*/
|
|
public function setSlug(string $slug)
|
|
{
|
|
$this->slug = $slug;
|
|
}
|
|
|
|
/**
|
|
* Returns the urltitle
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getUrltitle()
|
|
{
|
|
return $this->urltitle;
|
|
}
|
|
|
|
/**
|
|
* Sets the urltitle
|
|
*
|
|
* @param string $urltitle
|
|
* @return void
|
|
*/
|
|
public function setUrltitle(string $urltitle)
|
|
{
|
|
$this->urltitle = $urltitle;
|
|
}
|
|
|
|
|
|
/**
|
|
* Returns the seotitle
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getSeotitle()
|
|
{
|
|
return $this->seotitle;
|
|
}
|
|
|
|
/**
|
|
* Sets the seotitle
|
|
*
|
|
* @param string $seotitle
|
|
* @return void
|
|
*/
|
|
public function setSeotitle(string $seotitle)
|
|
{
|
|
$this->seotitle = $seotitle;
|
|
}
|
|
|
|
|
|
/**
|
|
* Returns the seometa
|
|
*
|
|
* @return string $seometa
|
|
*/
|
|
public function getSeometa()
|
|
{
|
|
return $this->seometa;
|
|
}
|
|
|
|
/**
|
|
* Sets the seometa
|
|
*
|
|
* @param string $seometa
|
|
* @return void
|
|
*/
|
|
public function setSeometa($seometa)
|
|
{
|
|
$this->seometa = $seometa;
|
|
}
|
|
|
|
/**
|
|
* Returns the keywords
|
|
*
|
|
* @return string $keywords
|
|
*/
|
|
public function getKeywords()
|
|
{
|
|
return $this->keywords;
|
|
}
|
|
|
|
/**
|
|
* Sets the keywords
|
|
*
|
|
* @param string $keywords
|
|
* @return void
|
|
*/
|
|
public function setKeywords($keywords)
|
|
{
|
|
$this->keywords = $keywords;
|
|
}
|
|
|
|
/**
|
|
* Returns the teaser
|
|
*
|
|
* @return string $kteasereywords
|
|
*/
|
|
public function getTeaser()
|
|
{
|
|
return $this->teaser;
|
|
}
|
|
|
|
/**
|
|
* Sets the teaser
|
|
*
|
|
* @param string $teaser
|
|
* @return void
|
|
*/
|
|
public function setTeaser($teaser)
|
|
{
|
|
$this->teaser = $teaser;
|
|
}
|
|
|
|
/**
|
|
* Returns the subtitle
|
|
*
|
|
* @return string $subtitle
|
|
*/
|
|
public function getSubtitle()
|
|
{
|
|
return $this->subtitle;
|
|
}
|
|
|
|
/**
|
|
* Sets the subtitle
|
|
*
|
|
* @param string $subtitle
|
|
* @return void
|
|
*/
|
|
public function setSubtitle($subtitle)
|
|
{
|
|
$this->subtitle = $subtitle;
|
|
}
|
|
|
|
/**
|
|
* Returns the hideonapp
|
|
*
|
|
* @return bool $hideonapp
|
|
*/
|
|
public function getHideonapp()
|
|
{
|
|
return $this->hideonapp;
|
|
}
|
|
|
|
/**
|
|
* Sets the hideonapp
|
|
*
|
|
* @param bool $hideonapp
|
|
* @return void
|
|
*/
|
|
public function setHideonapp($hideonapp)
|
|
{
|
|
$this->hideonapp = $hideonapp;
|
|
}
|
|
|
|
/**
|
|
* Returns the description
|
|
*
|
|
* @return bool $description
|
|
*/
|
|
public function getDescription()
|
|
{
|
|
return $this->description;
|
|
}
|
|
|
|
/**
|
|
* Sets the description
|
|
*
|
|
* @param bool $description
|
|
* @return void
|
|
*/
|
|
public function setDescriptionp($description)
|
|
{
|
|
$this->description = $description;
|
|
}
|
|
|
|
/**
|
|
* Returns the hideonwebsite
|
|
*
|
|
* @return bool $hideonwebsite
|
|
*/
|
|
public function getHideonwebsite()
|
|
{
|
|
return $this->hideonwebsite;
|
|
}
|
|
|
|
/**
|
|
* Sets the hideonwebsite
|
|
*
|
|
* @param bool $hideonwebsite
|
|
* @return void
|
|
*/
|
|
public function setHideonwebsite($hideonwebsite)
|
|
{
|
|
$this->hideonwebsite = $hideonwebsite;
|
|
}
|
|
|
|
/**
|
|
* Returns the hideondatasheets
|
|
*
|
|
* @return bool $hideondatasheets
|
|
*/
|
|
public function getHideondatasheets()
|
|
{
|
|
return $this->hideondatasheets;
|
|
}
|
|
|
|
/**
|
|
* Sets the hideondatasheets
|
|
*
|
|
* @param bool $hideondatasheets
|
|
* @return void
|
|
*/
|
|
public function setHideondatasheets($hideondatasheets)
|
|
{
|
|
$this->hideondatasheets = $hideondatasheets;
|
|
}
|
|
|
|
/**
|
|
* Returns the hideonproducts
|
|
*
|
|
* @return bool $hideonproducts
|
|
*/
|
|
public function getHideonproducts()
|
|
{
|
|
return $this->hideonproducts;
|
|
}
|
|
|
|
/**
|
|
* Sets the hideonproducts
|
|
*
|
|
* @param bool $hideonproducts
|
|
* @return void
|
|
*/
|
|
public function setHideonproducts($hideonproducts)
|
|
{
|
|
$this->hideonproducts = $hideonproducts;
|
|
}
|
|
|
|
/**
|
|
* Returns the structureddata
|
|
*
|
|
* @return string $structureddata
|
|
*/
|
|
public function getStructureddata()
|
|
{
|
|
return $this->structureddata;
|
|
}
|
|
|
|
/**
|
|
* Sets the structureddata
|
|
*
|
|
* @param string $structureddata
|
|
* @return void
|
|
*/
|
|
public function setStructureddata($structureddata)
|
|
{
|
|
$this->structureddata = $structureddata;
|
|
}
|
|
|
|
/**
|
|
* Returns the applications
|
|
*
|
|
* @return string $applications
|
|
*/
|
|
public function getApplications()
|
|
{
|
|
return $this->applications;
|
|
}
|
|
|
|
/**
|
|
* Sets the applications
|
|
*
|
|
* @param string $applications
|
|
* @return void
|
|
*/
|
|
public function setApplications($applications)
|
|
{
|
|
$this->applications = $applications;
|
|
}
|
|
|
|
/**
|
|
* Returns the highlights
|
|
*
|
|
* @return string $highlights
|
|
*/
|
|
public function getHighlights()
|
|
{
|
|
return $this->highlights;
|
|
}
|
|
|
|
/**
|
|
* Sets the highlights
|
|
*
|
|
* @param string $highlights
|
|
* @return void
|
|
*/
|
|
public function setHighlights($highlights)
|
|
{
|
|
$this->highlights = $highlights;
|
|
}
|
|
/**
|
|
* Returns the shortcutpid
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getShortcutpid()
|
|
{
|
|
return $this->shortcutpid;
|
|
}
|
|
|
|
/**
|
|
* Sets the shortcutpid
|
|
*
|
|
* @param string $shortcutpid
|
|
* @return void
|
|
*/
|
|
public function setShortcutpid ($shortcutpid)
|
|
{
|
|
$this->shortcutpid = $shortcutpid;
|
|
}
|
|
|
|
/**
|
|
* Returns the shortcut
|
|
*
|
|
* @return bool $shortcut
|
|
*/
|
|
public function getShortcut()
|
|
{
|
|
return $this->shortcut;
|
|
}
|
|
|
|
/**
|
|
* Sets the shortcut
|
|
*
|
|
* @param bool $shortcut
|
|
* @return void
|
|
*/
|
|
public function setShortcut($shortcut)
|
|
{
|
|
$this->shortcut = $shortcut;
|
|
}
|
|
|
|
/**
|
|
* Returns the legacy
|
|
*
|
|
* @return bool $legacy
|
|
*/
|
|
public function getLegacy()
|
|
{
|
|
return $this->legacy;
|
|
}
|
|
|
|
/**
|
|
* Sets the legacy
|
|
*
|
|
* @param bool $legacy
|
|
* @return void
|
|
*/
|
|
public function setLegacy($legacy)
|
|
{
|
|
$this->legacy = $legacy;
|
|
}
|
|
|
|
/**
|
|
* Returns the supportproduct
|
|
*
|
|
* @return bool $supportproduct
|
|
*/
|
|
public function getSupportproduct()
|
|
{
|
|
return $this->supportproduct;
|
|
}
|
|
|
|
/**
|
|
* Sets the supportproduct
|
|
*
|
|
* @param bool $supportproduct
|
|
* @return void
|
|
*/
|
|
public function setSupportproduct($supportproduct)
|
|
{
|
|
$this->supportproduct = $supportproduct;
|
|
}
|
|
|
|
/**
|
|
* Returns the subproduct
|
|
*
|
|
* @return bool $subproduct
|
|
*/
|
|
public function getSubproduct()
|
|
{
|
|
return $this->subproduct;
|
|
}
|
|
|
|
/**
|
|
* Sets the subproduct
|
|
*
|
|
* @param bool $subproduct
|
|
* @return void
|
|
*/
|
|
public function setSubproduct($subproduct)
|
|
{
|
|
$this->subproduct = $subproduct;
|
|
}
|
|
|
|
/**
|
|
* Initializes the ObjectStorage for categories
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->categories = new ObjectStorage();
|
|
$this->productimage = new ObjectStorage();
|
|
$this->downloads = new ObjectStorage();
|
|
}
|
|
|
|
/**
|
|
* Adds a category
|
|
*
|
|
* @param Category $category
|
|
* @return void
|
|
*/
|
|
public function addCategory(Category $category)
|
|
{
|
|
$this->categories->attach($category);
|
|
}
|
|
|
|
/**
|
|
* Removes a category
|
|
*
|
|
* @param Category $categoryToRemove
|
|
* @return void
|
|
*/
|
|
public function removeCategory(Category $categoryToRemove)
|
|
{
|
|
$this->categories->detach($categoryToRemove);
|
|
}
|
|
|
|
/**
|
|
* Returns the categories
|
|
*
|
|
* @return ObjectStorage<Category>
|
|
*/
|
|
public function getCategories()
|
|
{
|
|
return $this->categories;
|
|
}
|
|
|
|
/**
|
|
* Sets the categories
|
|
*
|
|
* @param ObjectStorage<Category> $categories
|
|
* @return void
|
|
*/
|
|
public function setCategories(ObjectStorage $categories)
|
|
{
|
|
$this->categories = $categories;
|
|
}
|
|
|
|
|
|
/**
|
|
* Adds a product image
|
|
*
|
|
* @param FileReference $productimage
|
|
* @return void
|
|
*/
|
|
public function addProductimage(FileReference $productimage)
|
|
{
|
|
$this->productimage->attach($productimage);
|
|
}
|
|
|
|
/**
|
|
* Removes a product image
|
|
*
|
|
* @param FileReference $productimageToRemove
|
|
* @return void
|
|
*/
|
|
public function removeProductimage(FileReference $productimageToRemove)
|
|
{
|
|
$this->productimage->detach($productimageToRemove);
|
|
}
|
|
|
|
/**
|
|
* Returns the product images
|
|
*
|
|
* @return ObjectStorage<FileReference>
|
|
*/
|
|
public function getProductimage()
|
|
{
|
|
return $this->productimage;
|
|
}
|
|
|
|
/**
|
|
* Sets the product images
|
|
*
|
|
* @param ObjectStorage<FileReference> $productimage
|
|
* @return void
|
|
*/
|
|
public function setProductimage(ObjectStorage $productimage)
|
|
{
|
|
$this->productimage = $productimage;
|
|
}
|
|
|
|
|
|
/**
|
|
* Adds a download
|
|
*
|
|
* @param \Evomedien\Vitec\Domain\Model\Download $download
|
|
* @return void
|
|
*/
|
|
public function addDownload(\Evomedien\Vitec\Domain\Model\Download $download): void
|
|
{
|
|
$this->downloads->attach($download);
|
|
}
|
|
|
|
/**
|
|
* Removes a download
|
|
*
|
|
* @param \Evomedien\Vitec\Domain\Model\Download $downloadToRemove
|
|
* @return void
|
|
*/
|
|
public function removeDownload(\Evomedien\Vitec\Domain\Model\Download $downloadToRemove): void
|
|
{
|
|
$this->downloads->detach($downloadToRemove);
|
|
}
|
|
|
|
/**
|
|
* Returns the downloads
|
|
*
|
|
* @return ObjectStorage<\Evomedien\Vitec\Domain\Model\Download>
|
|
*/
|
|
public function getDownloads(): ObjectStorage
|
|
{
|
|
return $this->downloads;
|
|
}
|
|
|
|
/**
|
|
* Sets the downloads
|
|
*
|
|
* @param ObjectStorage<\Evomedien\Vitec\Domain\Model\Download> $downloads
|
|
* @return void
|
|
*/
|
|
public function setDownloads(ObjectStorage $downloads): void
|
|
{
|
|
$this->downloads = $downloads;
|
|
}
|
|
|
|
|
|
/**
|
|
* Returns the Open Graph Image
|
|
*
|
|
* @return FileReference|null
|
|
*/
|
|
public function getOgimage(): ?FileReference
|
|
{
|
|
return $this->ogimage;
|
|
}
|
|
|
|
/**
|
|
* Sets the Open Graph Image
|
|
*
|
|
* @param FileReference $ogimage
|
|
* @return void
|
|
*/
|
|
public function setOgimage(FileReference $ogimage): void
|
|
{
|
|
$this->ogimage = $ogimage;
|
|
}
|
|
|
|
/**
|
|
* Returns the content element link
|
|
*
|
|
* @return string
|
|
*/
|
|
|
|
/**
|
|
* Returns the uploaded video file
|
|
*
|
|
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference|null
|
|
*/
|
|
public function getVideofile(): ?\TYPO3\CMS\Extbase\Domain\Model\FileReference
|
|
{
|
|
return $this->videofile;
|
|
}
|
|
|
|
/**
|
|
* Sets the uploaded video file
|
|
*
|
|
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference|null $videofile
|
|
* @return void
|
|
*/
|
|
public function setVideofile(?\TYPO3\CMS\Extbase\Domain\Model\FileReference $videofile): void
|
|
{
|
|
$this->videofile = $videofile;
|
|
}
|
|
|
|
|
|
/**
|
|
* Returns the showdatapath flag
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function getShowdatapath(): bool
|
|
{
|
|
return (bool)$this->showdatapath;
|
|
}
|
|
|
|
/**
|
|
* Sets the showdatapath flag
|
|
*
|
|
* @param bool $showdatapath
|
|
* @return void
|
|
*/
|
|
public function setShowdatapath(bool $showdatapath): void
|
|
{
|
|
$this->showdatapath = $showdatapath;
|
|
}
|
|
|
|
public function getContentelement(): string
|
|
{
|
|
return $this->contentelement;
|
|
}
|
|
|
|
/**
|
|
* Sets the content element link
|
|
*
|
|
* @param string $contentelement
|
|
* @return void
|
|
*/
|
|
public function setContentelement(string $contentelement): void
|
|
{
|
|
$this->contentelement = $contentelement;
|
|
}
|
|
|
|
/**
|
|
* Returns the content element cta link
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getContentelementcta(): string
|
|
{
|
|
return $this->contentelementcta;
|
|
}
|
|
|
|
/**
|
|
* Sets the content element link cta
|
|
*
|
|
* @param string $contentelementcta
|
|
* @return void
|
|
*/
|
|
public function setContentelementcta(string $contentelementcta): void
|
|
{
|
|
$this->contentelementcta = $contentelementcta;
|
|
}
|
|
|
|
/**
|
|
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Extension\Domain\Model\Product>
|
|
*/
|
|
public function getRelatedprodukt(): \TYPO3\CMS\Extbase\Persistence\ObjectStorage
|
|
{
|
|
return $this->relatedprodukt;
|
|
}
|
|
|
|
/**
|
|
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\Extension\Domain\Model\Product> $relatedprodukt
|
|
*/
|
|
public function setRelatedprodukt(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $relatedprodukt): void
|
|
{
|
|
$this->relatedprodukt = $relatedprodukt;
|
|
}
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
}
|