silverstripe-framework/tests
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
..
behat API Add new behat method for interacting with toasts (#9695) 2020-09-17 17:12:35 +12:00
bootstrap Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00
php NEW Add/remove callbacks on RelationList 2020-09-18 13:33:42 +12:00
bootstrap.php API Refactor bootstrap, request handling 2017-06-22 22:50:45 +12:00
dump_constants.php ENHANCEMENT Log user constants during CI for debugging improvements 2017-08-23 14:23:33 +12:00
phpcs_runner.php Use short array syntax across the framework's codebase 2020-05-16 10:34:45 +01:00