public function __call($method, $arguments)
{
$class = "\\Pimcore\\Model\\Document\\Tag\\" . ucfirst(strtolower($method));
$classFound = true;
if (!\Pimcore\Tool::classExists($class)) {
$oldStyleClass = "Document_Tag_" . ucfirst(strtolower($method));
if (!\Pimcore\Tool::classExists($oldStyleClass)) {
$classFound = false;
}
}
if ($classFound) {
if (!isset($arguments[0])) {
throw new \Exception("You have to set a name for the called tag (editable): " . $method);
}
// set default if there is no editable configuration provided
if (!isset($arguments[1])) {
$arguments[1] = [];
}
return $this->tag($method, $arguments[0], $arguments[1]);
}
if ($this->document instanceof Model\Document) {
if (method_exists($this->document, $method)) {
return call_user_func_array([$this->document, $method], $arguments);
}
}
return parent::__call($method, $arguments);
}