You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AbstractModule.php 728B

123456789101112131415161718192021222324252627
  1. <?php
  2. namespace common\logic;
  3. use yii\base\ErrorException;
  4. abstract class AbstractModule extends AbstractSingleton implements ModuleInterface
  5. {
  6. public function getEntityFqcn(): string
  7. {
  8. return $this->getDefinition()->getEntityFqcn();
  9. }
  10. public function __call($method, $args)
  11. {
  12. foreach($this->getServices() as $serviceClass) {
  13. if(method_exists($serviceClass, $method)) {
  14. return call_user_func_array(
  15. [$serviceClass::getInstance(), $method],
  16. $args
  17. );
  18. }
  19. }
  20. throw new ErrorException('La méthode '.$method.' est introuvable dans les services du module '.get_class($this));
  21. }
  22. }