Rules.php 751 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * This file is part of the ForkBB <https://github.com/forkbb>.
  4. *
  5. * @copyright (c) Visman <mio.visman@yandex.ru, https://github.com/MioVisman>
  6. * @license The MIT License (MIT)
  7. */
  8. declare(strict_types=1);
  9. namespace ForkBB\Models;
  10. use ForkBB\Models\Model;
  11. use RuntimeException;
  12. class Rules extends Model
  13. {
  14. /**
  15. * Флаг готовности
  16. * @var bool
  17. */
  18. protected $ready = false;
  19. /**
  20. * Возвращает значение свойства
  21. */
  22. public function __get(string $name) /* : mixed */
  23. {
  24. if (true === $this->ready) {
  25. return parent::__get($name);
  26. } else {
  27. throw new RuntimeException('The model of rules isn\'t ready');
  28. }
  29. }
  30. }