Replies: 1 comment 1 reply
-
Hello, could you please also provide partial SQL create table code for better case simulation? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm trying to migrate from Phalcon v3 to v5 but I have a problem with updating related entity.
I have an entity Document and this entity has related entity DocumentHistory.
On Document entity there is hasMany relationship defined:
$this->hasMany('id', DocumentHistory::class, 'idDocument', ['alias' => 'documentHistories']);
DocumentHistory entity has belongsTo relationship:
$this->belongsTo('idDocument', Document::class, 'id',['alias' => 'document']);
when I create new DocumentHistory entity and assign existing Document entity, change some values on this entity (Document) and save DocumentHistory entity, only DocumentHistory is saved (created). Document entity is not updated but foreign key is set on DocumentHistory entity correctly. In case when both entities exist it works correctly.
On DocumentHistory there is a setter:
This works for Phalcon v3. This will not be supported in v5 or it is a bug? Thank you.
My environent:
PHP 8.1.
Phalcon 5.1.0.
Postgresql 11
Beta Was this translation helpful? Give feedback.
All reactions