‪TYPO3CMS  10.4
EventCallback.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
22 {
26  protected ‪$object;
27 
31  protected ‪$method;
32 
36  protected ‪$targetArguments;
37 
45  public function ‪__construct(‪$object, ‪$method, array ‪$targetArguments = [])
46  {
47  $this->object = ‪$object;
48  $this->method = ‪$method;
49  $this->targetArguments = ‪$targetArguments;
50  $this->targetArguments['target'] = ‪$object;
51  }
52 
61  public function ‪execute(array $callerArguments = [], $caller, $eventName)
62  {
63  $callable = [‪$this->object, ‪$this->method];
64  if (is_callable($callable)) {
65  return $callable($callerArguments, $this->targetArguments, $caller, $eventName);
66  }
67  return null;
68  }
69 }
‪TYPO3\CMS\Workspaces\Dependency\EventCallback\$targetArguments
‪array $targetArguments
Definition: EventCallback.php:33
‪TYPO3\CMS\Workspaces\Dependency\EventCallback\__construct
‪__construct($object, $method, array $targetArguments=[])
Definition: EventCallback.php:42
‪TYPO3\CMS\Workspaces\Dependency\EventCallback
Definition: EventCallback.php:22
‪TYPO3\CMS\Workspaces\Dependency
Definition: DependencyEntityFactory.php:16
‪TYPO3\CMS\Workspaces\Dependency\EventCallback\execute
‪mixed execute(array $callerArguments=[], $caller, $eventName)
Definition: EventCallback.php:58
‪TYPO3\CMS\Workspaces\Dependency\EventCallback\$object
‪object $object
Definition: EventCallback.php:25
‪TYPO3\CMS\Workspaces\Dependency\EventCallback\$method
‪string $method
Definition: EventCallback.php:29