Sometimes I encounter a public static function create()
in plugin classes, for the example in the code show in Tutorial on Using Drupal 8 Plugin Derivatives Effectively.
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static(
$container->get('entity.manager')->getStorage('node')
);
}
Could you clarify me what the purpose of that function is, for example what it should do and where it's used?