public function EntitySubject::__construct in Changed Fields API 8.3
Constructs content entity subject.
Parameters
Drupal\Core\Entity\ContentEntityInterface $entity: Content entity to look at.
string $field_comparator_plugin_id: Field comparator plugin id.
File
- src/
EntitySubject.php, line 48
Class
- EntitySubject
- Implements content entity subject.
Namespace
Drupal\changed_fieldsCode
public function __construct(ContentEntityInterface $entity, $field_comparator_plugin_id = 'default_field_comparator') {
$this->entity = $entity;
$this->changedFields = [];
$this->fieldComparatorPlugin = \Drupal::service('plugin.manager.changed_fields.field_comparator')
->createInstance($field_comparator_plugin_id);
}