You are here

public function Flagging::__construct in Flag 8.4

Constructs an Entity object.

Parameters

array $values: An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

string $entity_type: The type of the entity to create.

Overrides ContentEntityBase::__construct

File

src/Entity/Flagging.php, line 62

Class

Flagging
Provides the flagging content entity.

Namespace

Drupal\flag\Entity

Code

public function __construct(array $values, $entity_type, $bundle = FALSE, $translations = []) {
  if (isset($values['entity_id'])) {
    $values['flagged_entity'] = $values['entity_id'];
  }
  parent::__construct($values, $entity_type, $bundle, $translations);
}