silverstripe-framework/tests/php
Sam Minnee 0d7c5a9ece NEW Add/remove callbacks on RelationList
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
2020-09-18 13:33:42 +12:00
..
Control [CVE-2019-19326] Stop honouring X-HTTP-Method-Override header, X-Original-Url header and _method POST variable. Add SS_HTTPRequest::setHttpMethod() 2020-07-10 17:56:15 +12:00
Core Merge branch '4.6' into 4 2020-09-09 13:58:35 +12:00
Dev API: Allow for user-created objects to have values passed in the constructor (#8591) 2020-08-20 12:28:31 +12:00
Forms Merge branch '4.6' into 4 2020-09-11 11:54:23 +12:00
i18n Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
Logging Merge branch '4.3' into 4.4 2019-10-18 10:57:35 +13:00
ORM NEW Add/remove callbacks on RelationList 2020-09-18 13:33:42 +12:00
Security BUG Always validate Member credentials against DRAFT stage (#9671) 2020-09-08 11:47:04 +12:00
View NEW Cache embed shortcodes 2020-08-12 12:14:05 +12:00