From 7530f5fee007a2c32c1061cecbb7e1b232f72a65 Mon Sep 17 00:00:00 2001 From: Visman Date: Wed, 22 Nov 2023 13:48:33 +0700 Subject: [PATCH] Models\Model.: Add setManager() method to pass the current Manager to the model --- app/Models/Model.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/Models/Model.php b/app/Models/Model.php index 6d3082bc..bdf4a8a2 100644 --- a/app/Models/Model.php +++ b/app/Models/Model.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace ForkBB\Models; use ForkBB\Core\Container; +use ForkBB\Models\Manager; class Model { @@ -34,6 +35,11 @@ class Model */ protected array $zDepend = []; + /** + * Текущий Manager для модели + */ + protected Manager $manager; + public function __construct(protected Container $c) { } @@ -165,4 +171,14 @@ class Model return $this->c->$key->setModel($this)->$name(...$args); } + + /** + * Объявление менеджера + */ + public function setManager(Manager $manager): Model + { + $this->manager = $manager; + + return $this; + } }