TYPO3 CMS  TYPO3_6-2
Configuration.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
19 
25  protected $interceptors = array();
26 
33  public function addInterceptor(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface $interceptor) {
34  foreach ($interceptor->getInterceptionPoints() as $interceptionPoint) {
35  if (!isset($this->interceptors[$interceptionPoint])) {
36  $this->interceptors[$interceptionPoint] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
37  }
38  if (!$this->interceptors[$interceptionPoint]->contains($interceptor)) {
39  $this->interceptors[$interceptionPoint]->attach($interceptor);
40  }
41  }
42  }
43 
50  public function getInterceptors($interceptionPoint) {
51  if (isset($this->interceptors[$interceptionPoint]) && $this->interceptors[$interceptionPoint] instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage) {
52  return $this->interceptors[$interceptionPoint];
53  }
54  return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
55  }
56 }
addInterceptor(\TYPO3\CMS\Fluid\Core\Parser\InterceptorInterface $interceptor)