* Abstract container to simplify the development of * simple containers */ abstract class AbstractExecutionContainer implements ExecutionContainer { /** * @var array */ private $data = []; /** * @var DeliveryExecution */ private $deliveryExecution; /** * DeliveryContainer constructor. * @param DeliveryExecution $deliveryExecution */ public function __construct(DeliveryExecution $deliveryExecution) { $this->deliveryExecution = $deliveryExecution; } /** * {@inheritDoc} * @see \oat\taoDelivery\model\container\ExecutionContainer::setData() */ public function setData($key, $value) { $this->data[$key] = $value; } /** * @return \Renderer */ public function getContainerHeader() { $renderer = new \Renderer($this->getHeaderTemplate()); $renderer->setMultipleData($this->data); return $renderer; } /** * @return \Renderer */ public function getContainerBody() { $renderer = new \Renderer($this->getBodyTemplate()); $renderer->setMultipleData($this->data); return $renderer; } /** * Returns the path to the header template * @return string */ abstract protected function getHeaderTemplate(); /** * Returns the path to the body template * @return string */ abstract protected function getBodyTemplate(); }