diff --git a/src/Model/Join.php b/src/Model/Join.php index 5b1034bb8..27ff859b2 100644 --- a/src/Model/Join.php +++ b/src/Model/Join.php @@ -11,7 +11,6 @@ use Atk4\Data\Exception; use Atk4\Data\Field; use Atk4\Data\Model; -use Atk4\Data\Persistence; use Atk4\Data\Reference; /** @@ -37,20 +36,10 @@ abstract class Join */ protected $foreign_table; - /** - * If $persistence is set, then it's used for loading - * and storing the values, instead $owner->persistence. - * - * @var Persistence|Persistence\Sql|null - */ - protected $persistence; - /** * Field that is used as native "ID" in the foreign table. * When deleting record, this field will be conditioned. * - * ->where($join->id_field, $join->id)->delete(); - * * @var string */ protected $id_field = 'id'; @@ -64,7 +53,7 @@ abstract class Join */ protected $kind; - /** @var bool Is our join weak? Weak join will stop you from touching foreign table. */ + /** @var bool Weak join does not update foreign table. */ protected $weak = false; /** @@ -74,7 +63,7 @@ abstract class Join * * If you are using the following syntax: * - * $user->join('contact','default_contact_id'); + * $user->join('contact', 'default_contact_id'); * * Then the ID connecting tables is stored in foreign table and the order * of saving and delete needs to be reversed. In this case $reverse @@ -541,7 +530,7 @@ public function beforeInsert(Model $entity, array &$data): void $data[$this->master_field] = $this->getId($entity); } - // $entity->set($this->master_field, $this->getId($entity)); + // $entity->set($this->master_field, $this->getId($entity)); // TODO needed? from array persistence } public function afterInsert(Model $entity): void @@ -550,7 +539,7 @@ public function afterInsert(Model $entity): void return; } - $this->setSaveBufferValue($entity, $this->foreign_field, $this->hasJoin() ? $this->getJoin()->getId($entity) : $entity->getId()); // from array persistence... + $this->setSaveBufferValue($entity, $this->foreign_field, $this->hasJoin() ? $this->getJoin()->getId($entity) : $entity->getId()); // TODO needed? from array persistence $foreignModel = $this->getForeignModel(); $foreignEntity = $foreignModel->createEntity() diff --git a/src/Persistence/Array_/Join.php b/src/Persistence/Array_/Join.php index 6861303b9..517e82e0d 100644 --- a/src/Persistence/Array_/Join.php +++ b/src/Persistence/Array_/Join.php @@ -8,9 +8,6 @@ use Atk4\Data\Model; use Atk4\Data\Persistence; -/** - * @property Persistence\Array_|null $persistence - */ class Join extends Model\Join { public function afterLoad(Model $entity): void diff --git a/src/Persistence/Sql/Join.php b/src/Persistence/Sql/Join.php index d41aecdd2..787a1003c 100644 --- a/src/Persistence/Sql/Join.php +++ b/src/Persistence/Sql/Join.php @@ -7,9 +7,6 @@ use Atk4\Data\Model; use Atk4\Data\Persistence; -/** - * @property Persistence\Sql $persistence - */ class Join extends Model\Join { /**