1 | <?php |
||
26 | class AuditBlockService extends BaseBlockService |
||
27 | { |
||
28 | /** |
||
29 | * @var AuditReader |
||
30 | */ |
||
31 | protected $auditReader; |
||
32 | |||
33 | /** |
||
34 | * @param string $name |
||
35 | * @param EngineInterface $templating |
||
36 | * @param AuditReader $auditReader |
||
37 | */ |
||
38 | public function __construct($name, EngineInterface $templating, AuditReader $auditReader) |
||
39 | { |
||
40 | parent::__construct($name, $templating); |
||
41 | |||
42 | $this->auditReader = $auditReader; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function execute(BlockContextInterface $blockContext, Response $response = null) |
||
49 | { |
||
50 | $revisions = array(); |
||
51 | |||
52 | foreach ($this->auditReader->findRevisionHistory($blockContext->getSetting('limit'), 0) as $revision) { |
||
53 | $revisions[] = array( |
||
54 | 'revision' => $revision, |
||
55 | 'entities' => $this->auditReader->findEntitesChangedAtRevision($revision->getRev()), |
||
|
|||
56 | ); |
||
57 | } |
||
58 | |||
59 | return $this->renderResponse($blockContext->getTemplate(), array( |
||
60 | 'block' => $blockContext->getBlock(), |
||
61 | 'settings' => $blockContext->getSettings(), |
||
62 | 'revisions' => $revisions, |
||
63 | ), $response); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | public function buildEditForm(FormMapper $formMapper, BlockInterface $block) |
||
72 | |||
73 | /** |
||
74 | * {@inheritdoc} |
||
75 | */ |
||
76 | public function getName() |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | */ |
||
84 | public function configureSettings(OptionsResolver $resolver) |
||
91 | } |
||
92 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.