<?php declare(strict_types=1); /* * This file is part of Affentaler customizations for Contao. * * (c) Benjamin Roth * * @license commercial */ namespace vonRotenberg\WmfgoCevisioBundle\Model\Import; use Contao\CoreBundle\InsertTag\InsertTagParser; use Contao\System; class ProductModel { /** * @var array */ private array $arrData; public function __get($name) { return $this->get($name); } public function __set($name, $value) { $this->set($name,$value); } public function __call($name, $arguments) { if (strncmp($name, 'get', 3) === 0) { $name = lcfirst(substr($name, 3)); return $this->get($name); } else if (strncmp($name, 'set', 3) === 0) { $name = lcfirst(substr($name, 3)); $this->set($name,$arguments[0]); } } public function get(string $name) { if (isset($this->arrData[$name])) { $insertTagParser = System::getContainer()->get(InsertTagParser::class); return $insertTagParser->replace($this->arrData[$name]); } return null; } public function set(string $name, $value): void { $this->arrData[$name] = $value; } public function getData(): ?array { return $this->arrData; } }