-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from mia3/dimension-handling
DimensionMapping
- Loading branch information
Showing
12 changed files
with
553 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<?php | ||
namespace Crossmedia\Fourallportal\Domain\Model; | ||
|
||
/*** | ||
* | ||
* This file is part of the "4AllPortal Connector" 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) 2017 Marc Neuhaus <[email protected]>, MIA3 GmbH & Co. KG | ||
* | ||
***/ | ||
use Crossmedia\Fourallportal\Domain\Repository\ModuleRepository; | ||
use Crossmedia\Fourallportal\Mapping\MappingInterface; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Extbase\Object\ObjectManager; | ||
|
||
/** | ||
* Module | ||
*/ | ||
class Dimension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $name = ''; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $value = ''; | ||
|
||
/** | ||
* server | ||
* | ||
* @var \Crossmedia\Fourallportal\Domain\Model\DimensionMapping | ||
*/ | ||
protected $mapping = null; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @param string $name | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* @param string $value | ||
*/ | ||
public function setValue($value) | ||
{ | ||
$this->value = $value; | ||
} | ||
|
||
/** | ||
* @return DimensionMapping | ||
*/ | ||
public function getMapping() | ||
{ | ||
return $this->mapping; | ||
} | ||
|
||
/** | ||
* @param DimensionMapping $mapping | ||
*/ | ||
public function setMapping($mapping) | ||
{ | ||
$this->mapping = $mapping; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?php | ||
namespace Crossmedia\Fourallportal\Domain\Model; | ||
|
||
/*** | ||
* | ||
* This file is part of the "4AllPortal Connector" 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) 2017 Marc Neuhaus <[email protected]>, MIA3 GmbH & Co. KG | ||
* | ||
***/ | ||
use Crossmedia\Fourallportal\Domain\Repository\ModuleRepository; | ||
use Crossmedia\Fourallportal\Mapping\MappingInterface; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Extbase\Object\ObjectManager; | ||
|
||
/** | ||
* Module | ||
*/ | ||
class DimensionMapping extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
protected $language = ''; | ||
|
||
/** | ||
* server | ||
* | ||
* @var \Crossmedia\Fourallportal\Domain\Model\Server | ||
*/ | ||
protected $server = null; | ||
|
||
/** | ||
* modules | ||
* | ||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Crossmedia\Fourallportal\Domain\Model\Dimension> | ||
* @cascade remove | ||
*/ | ||
protected $dimensions = null; | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getLanguage() | ||
{ | ||
return $this->language; | ||
} | ||
|
||
/** | ||
* @param int $language | ||
*/ | ||
public function setLanguage($language) | ||
{ | ||
$this->language = $language; | ||
} | ||
|
||
/** | ||
* @return Server | ||
*/ | ||
public function getServer() | ||
{ | ||
return $this->server; | ||
} | ||
|
||
/** | ||
* @param Server $server | ||
*/ | ||
public function setServer($server) | ||
{ | ||
$this->server = $server; | ||
} | ||
|
||
/** | ||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage | ||
*/ | ||
public function getDimensions() | ||
{ | ||
return $this->dimensions; | ||
} | ||
|
||
/** | ||
* @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $dimensions | ||
*/ | ||
public function setDimensions($dimensions) | ||
{ | ||
$this->dimensions = $dimensions; | ||
} | ||
|
||
public function matches($dimensions) { | ||
foreach ($this->dimensions as $dimension) { | ||
if ($dimensions[$dimension->getName()] != $dimension->getValue()) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.