Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294415

Change order of parameters in Entity constructors

$
0
0

It's a follow-up from #1796604: Make constructor parameters consistent

Problem/Motivation

There's a inconsistensy in parameters order for:
- entity_create($entity_type, array $values)
- EntityInterface::__construct(array $values, $entity_type)
Also all derived interfaces & implementations are using
ContentEntityInterface::__construct(array $values = array(), $entity_type) with defaults

Proposed resolution

Make $entity_type the first and required parameter and optional $values array line entity_create() does


Viewing all articles
Browse latest Browse all 294415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>