Warning: You are browsing the documentation from version 4 to 10 of Pimcore.
Please visit https://pimcore.com/docs/platform/ for the latest versions of Pimcore.
Version:
PHP Code
Allows you to provide a custom getter implementation.
Sample implementation.
<?php
namespace AppBundle\Operator;
use Pimcore\DataObject\GridColumnConfig\Operator\AbstractOperator;
use Pimcore\DataObject\GridColumnConfig\ResultContainer;
class OperatorSample extends AbstractOperator
{
private $additionalData;
public function __construct(\stdClass $config, $context = null)
{
parent::__construct($config, $context);
$this->additionalData = $config->additionalData;
}
public function getLabeledValue($element)
{
$childs = $this->getChilds();
$result = new ResultContainer();
$result->setValue($element->getId() . " huhu " . count($childs) . " " . $this->additionalData);
return $result;
}
}