mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
0d7c5a9ece
This provides a mechanism for adjusting the behaviour of these relations when building more complex data models. For example the following example has a status field incorporates a Status field into the relationship: ```php function MyRelation() { $rel = $this->getManyManyComponents(‘MyRelation’); $rel = $rel->filter(‘Status’, ‘Active’); $rel->addCallbacks()->add(function ($relation, $item, $extra) { $item->Status = ‘Active’; $item->write(); }); } ``` Introduces a new library dependency: http://github.com/sminnee/callbacklist |
||
---|---|---|
.. | ||
Control | ||
Core | ||
Dev | ||
Forms | ||
i18n | ||
Logging | ||
ORM | ||
Security | ||
View |