Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Most APIs in Drupal are chainable, so you can do something like:
$cache = \Drupal::cache();
$cache
->set('foo', 'bar')
->set('bar', 'baz')
->delete('baz');
Comments
Comment #1
BerdirWhy not, but how useful is this really? how many times do you call set() or delete multiple times in a row?
Comment #2
dawehnerWell, yeah agreed, maybe its not that important for cache, but its just what people kind of except.