Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InterpretationStrategy.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  private $renderersPool;
17 
21  private $messageConfigurationsPool;
22 
27  public function __construct(
28  RenderersPool $renderersPool,
29  MessageConfigurationsPool $messageConfigurationsPool
30  ) {
31  $this->renderersPool = $renderersPool;
32  $this->messageConfigurationsPool = $messageConfigurationsPool;
33  }
34 
43  {
44  $messageConfiguration = $this->messageConfigurationsPool->getMessageConfiguration(
45  $message->getIdentifier()
46  );
47  if (null === $messageConfiguration) {
48  throw new \LogicException();
49  }
50 
51  $renderer = $this->renderersPool->get($messageConfiguration['renderer']);
52  if (null === $renderer) {
53  throw new \LogicException();
54  }
55 
56  return $renderer->render($message, $messageConfiguration['data']);
57  }
58 }
__construct(RenderersPool $renderersPool, MessageConfigurationsPool $messageConfigurationsPool)
$message