Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

28 wiersze
602B

  1. <?php
  2. namespace Framework\Database;
  3. use Framework\Database\ModelCollector;
  4. class Relationship
  5. {
  6. public ModelCollector $collector;
  7. public string $method;
  8. public function __construct(ModelCollector $collector, string $method)
  9. {
  10. $this->collector = $collector;
  11. $this->method = $method;
  12. }
  13. public function __invoke(array $parameters = []): mixed
  14. {
  15. return $this->collector->$method(...$parameters);
  16. }
  17. public function __call(string $method, array $parameters = []): mixed
  18. {
  19. return $this->collector->$method(...$parameters);
  20. }
  21. }

Powered by TurnKey Linux.