選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

27 行
724B

  1. <?php
  2. namespace domain\_;
  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. }