initial commit

This commit is contained in:
origin
2023-12-04 16:40:27 +01:00
commit 813b2d3da4
133 changed files with 50635 additions and 0 deletions

View File

@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Model;
use A2G\A2gMaps\Domain\Model\MapEntry as BaseMapEntry;
use TYPO3\CMS\Extbase\Domain\Model\FileReference;
use TYPO3\CMS\Extbase\Annotation\ORM\{
Cascade,
Lazy
};
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
/**
* This file is part of the "altogether 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
*/
/**
* MapEntry
*/
class MapEntry extends BaseMapEntry {
/**
* relTravelPost
*
* @Cascade("remove")
* @Lazy
* @var TravelPost
*/
protected $relTravelPost = null;
/**
*
* @return TravelPost
*/
public function getRelTravelPost(): TravelPost {
if ($this->relTravelPost instanceof LazyLoadingProxy) {
$this->relTravelPost = $this->relTravelPost->_loadRealInstance();
}
return $this->relTravelPost;
}
/**
*
* @param TravelPost $relTravelPost
* @return void
*/
public function setRelTravelPost(TravelPost $relTravelPost): void {
$this->relTravelPost = $relTravelPost;
}
}

View File

@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Model;
use T3G\AgencyPack\Blog\Domain\Model\Author;
use A2G\A2gTravelBlog\Domain\Model\TravelMarker;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
/**
* 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
*/
/**
* TravelAuthor
*/
class TravelAuthor extends Author {
/**
* relMapMarker
*
* @var TravelMarker
* @TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
*/
protected $relMapMarker = null;
/**
* Returns the relMapMarker
*
* @return TravelMarker $relMapMarker
*/
public function getRelMapMarker() {
if ($this->relMapMarker instanceof LazyLoadingProxy) {
$this->relMapMarker = $this->relMapMarker->_loadRealInstance();
}
return $this->relMapMarker;
}
/**
* Sets the relMapMarker
*
* @param TravelMarker $relMapMarker
* @return void
*/
public function setRelMapMarker(TravelMarker $relMapMarker) {
$this->relMapMarker = $relMapMarker;
}
}

View File

@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Model;
use T3G\AgencyPack\Blog\Domain\Model\Category;
/**
* 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
*/
/**
* TravelCategory
*/
class TravelCategory extends Category {
/**
* isoA2CountryCode
*
* @var string
*/
protected $isoA2CountryCode = '';
public function getIsoA2CountryCode(): string {
return $this->isoA2CountryCode;
}
public function setIsoA2CountryCode(string $isoA2CountryCode): void {
$this->isoA2CountryCode = $isoA2CountryCode;
}
}

View File

@ -0,0 +1,56 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Model;
use A2G\A2gMaps\Domain\Model\Marker;
use A2G\A2gTravelBlog\Domain\Model\TravelAuthor;
use TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy;
/**
* 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
*/
/**
* TravelMarker
*/
class TravelMarker extends Marker {
/**
* relTravelAuthor
*
* @var TravelAuthor
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
*/
protected $relTravelAuthor = null;
/**
* Returns the relTravelAuthor
*
* @return TravelAuthor $relTravelAuthor
*/
public function getRelTravelAuthor() {
if ($this->relTravelAuthor instanceof LazyLoadingProxy) {
$this->relTravelAuthor = $this->relTravelAuthor->_loadRealInstance();
}
return $this->relTravelAuthor;
}
/**
* Sets the relTravelAuthor
*
* @param TravelAuthor $relTravelAuthor
* @return void
*/
public function setRelTravelAuthor(TravelAuthor $relTravelAuthor) {
$this->relTravelAuthor = $relTravelAuthor;
}
}

View File

@ -0,0 +1,86 @@
<?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;
}
}

View File

@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Repository;
use TYPO3\CMS\Core\Utility\MathUtility;
/**
* 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
*/
/**
* The repository for MapEntry
*/
class MapEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* @var array
*/
// protected $defaultOrderings = [
// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
// ];
static protected function mapInt($value){
if(MathUtility::canBeInterpretedAsInteger($value)){
return (int)$value;
}
return null;
}
public function getFromCategoryUids(array $uids){
$uidsFiltered = array_filter(array_map('self::mapInt', $uids));
$query = $this->createQuery();
$query->matching(
$query->logicalOr($query->in('relTravelPost.categories.uid', $uidsFiltered)));
return $query->execute();
}
public function initializeObject() {
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
}

View File

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Repository;
use TYPO3\CMS\Core\Utility\MathUtility;
/**
* This file is part of the "Travel Blog" 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
*/
/**
* The repository for TravelAuthor
*/
class TravelAuthorRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* @var array
*/
// protected $defaultOrderings = [
// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
// ];
static protected function mapInt($value){
if(MathUtility::canBeInterpretedAsInteger($value)){
return (int)$value;
}
return null;
}
public function getFromUids(array $uids){
$uidsFiltered = array_filter(array_map('self::mapInt', $uids));
$query = $this->createQuery();
$query->matching(
$query->logicalOr($query->in('uid', $uidsFiltered)));
return $query->execute();
}
public function initializeObject() {
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
}

View File

@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Repository;
use TYPO3\CMS\Core\Utility\MathUtility;
/**
* 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
*/
/**
* The repository for TravelPost
*/
class TravelCategoryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* @var array
*/
// protected $defaultOrderings = [
// 'sorting' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING
// ];
//
static protected function mapInt($value){
if(MathUtility::canBeInterpretedAsInteger($value)){
return (int)$value;
}
return null;
}
public function initializeObject() {
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
}

View File

@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Repository;
use TYPO3\CMS\Core\Utility\MathUtility;
/**
* 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
*/
/**
* The repository for TravelPost
*/
class TravelPostRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
/**
* @var array
*/
protected $defaultOrderings = [
'crdate' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
];
static protected function mapInt($value){
if(MathUtility::canBeInterpretedAsInteger($value)){
return (int)$value;
}
return null;
}
public function getFromCategoryUids(array $uids){
$uidsFiltered = array_filter(array_map('self::mapInt', $uids));
$query = $this->createQuery();
$query->matching($query->in('categories.uid', $uidsFiltered));
return $query->execute();
}
public function getFromAuthorUids(array $uids){
$uidsFiltered = array_filter(array_map('self::mapInt', $uids));
$query = $this->createQuery();
$query->matching($query->in('authors.uid', $uidsFiltered));
return $query->execute();
}
public function getFromTagUids(array $uids){
$uidsFiltered = array_filter(array_map('self::mapInt', $uids));
$query = $this->createQuery();
$query->matching($query->in('tags.uid', $uidsFiltered));
return $query->execute();
}
public function initializeObject() {
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings::class);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
}

View File

@ -0,0 +1,35 @@
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
declare(strict_types=1);
namespace A2G\A2gTravelBlog\Domain\Traits;
use TYPO3\CMS\Extbase\Service\ImageService;
/**
* Description of InjectImageServiceTrait
*
* @author Raphael Martin
*/
trait InjectImageServiceTrait {
/**
* imageService
*
* @var ImageService
*/
protected $imageService = null;
/**
* @param ImageService $imageService
*/
public function injectImageService(ImageService $imageService) {
$this->imageService = $imageService;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace A2G\A2gTravelBlog\Domain\Traits;
use A2G\A2gTravelBlog\Domain\Repository\MapEntryRepository;
/**y
* Description of InjectMapEntryRepositoryTrait
*
* @author Raphael Martin
*/
trait InjectMapEntryRepositoryTrait {
/**
*
* @var MapEntryRepository
*/
protected $mapEntryRepository = null;
/**
* @param MapEntryRepository $mapEntryRepository
*/
public function injectMapEntryRepository(MapEntryRepository $mapEntryRepository) {
$this->mapEntryRepository = $mapEntryRepository;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace A2G\A2gTravelBlog\Domain\Traits;
use A2G\A2gTravelBlog\Domain\Repository\TravelAuthorRepository;
/**y
* Description of InjectTravelAuthorRepositoryTrait
*
* @author Raphael Martin
*/
trait InjectTravelAuthorRepositoryTrait {
/**
*
* @var TravelAuthorRepository
*/
protected $travelAuthorRepository = null;
/**
* @param TravelAuthorRepository $travelAuthorRepository
*/
public function injectTravelAuthorRepository(TravelAuthorRepository $travelAuthorRepository) {
$this->travelAuthorRepository = $travelAuthorRepository;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace A2G\A2gTravelBlog\Domain\Traits;
use A2G\A2gTravelBlog\Domain\Repository\TravelCategoryRepository;
/**
* Description of InjectIngredientsRepositoryTrait
*
* @author Raphael Martin
*/
trait InjectTravelCategoryRepositoryTrait {
/**
*
* @var TravelCategoryRepository
*/
protected $travelCategoryRepository = null;
/**
* @param TravelCategoryRepository $travelCategoryRepository
*/
public function injectTravelCategoryRepository(TravelCategoryRepository $travelCategoryRepository) {
$this->travelCategoryRepository = $travelCategoryRepository;
}
}

View File

@ -0,0 +1,27 @@
<?php
namespace A2G\A2gTravelBlog\Domain\Traits;
use A2G\A2gTravelBlog\Domain\Repository\TravelPostRepository;
/**
* Description of InjectIngredientsRepositoryTrait
*
* @author Raphael Martin
*/
trait InjectTravelPostRepositoryTrait {
/**
*
* @var TravelPostRepository
*/
protected $travelPostRepository = null;
/**
* @param TravelPostRepository $travelPostRepository
*/
public function injectTravelPostRepository(TravelPostRepository $travelPostRepository) {
$this->travelPostRepository = $travelPostRepository;
}
}