What cascade "refresh" means in Doctrine2? Is it entity update operation?
UPDATE
Now it seems that if, for example, category name is changed, all related products will be fetched and updated. But, since usually entities are related only via id, there is no sense fetch all products, because there is nothing to update in child table. For this reason, I suppose that "refresh" is analogue of MySQL "ON UPDATE CASCADE" - if the parent primary key is changed, the child value will also change to reflect that. So Doctrine "refresh" operation is the same only in ORM level. And make sense only if we update parent id, am I right?
You can find the documentation here, but for summary I will copy some important point:
Copying all the section is unnecessary since everybody can open the link but the idea of cascade is clear from this part.
doing some automatic stuff on associations by doctrine.
In
refresh cascade
case, when you define this cascade on a@oneToMany
association, you are asking doctrine to refresh thecollection
on many side when you dorefresh
on one side.lets say we have
one-to-many
association betweenCategory
andProduct
entities. If you define this cascade for it, everytime you invokerefresh
on anyCategory
itsProducts Collection
will be refreshed.About this part of your question: Is it entity update operation? yes, In
Refresh
It means fetching collections and entities from data source into the memory.