a2g_travel_blog/Classes/Domain/Model/TravelPost.php

87 lines
1.8 KiB
PHP
Raw Normal View History

2023-12-04 16:40:27 +01:00
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Model;
use \T3G\AgencyPack\Blog\Domain\Model\Post;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
/**
* This file is part of the "Products" 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) 2021 Raphael Martin <raphy.martin@gmail.com>, none
*/
/**
* TravelPost
*/
class TravelPost extends Post {
/**
* relMapEntries
*
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\A2G\A2gTravelBlog\Domain\Model\MapEntry>
*/
protected $relMapEntries = null;
/**
* Post constructor.
*/
public function __construct()
{
parent::__construct();
$this->initializeObject();
}
/**
* initializeObject
*/
public function initializeObject(): void
{
$this->relMapEntries = new ObjectStorage();
}
/**
* @return ObjectStorage
*/
public function getRelMapEntries(): ObjectStorage
{
return $this->relMapEntries;
}
/**
* @param ObjectStorage $relMapEntries
* @return TravelPost
*/
public function setRelMapEntries($relMapEntries): self
{
$this->relMapEntries = $relMapEntries;
return $this;
}
/**
* @param MapEntry $relMapEntry
* @return TravelPost
*/
public function addRelMapEntry(MapEntry $relMapEntry): self
{
$this->relMapEntries->attach($relMapEntry);
return $this;
}
/**
* @param MapEntry $relMapEntry
*
* @return TravelPost
*/
public function removeRelMapEntry(MapEntry $relMapEntry): self
{
$this->relMapEntries->detach($relMapEntry);
return $this;
}
}