You are here

class EntityConditionGroupNormalizer in JSON:API 8

The normalizer used for entity conditions.

@internal

Hierarchy

Expanded class hierarchy of EntityConditionGroupNormalizer

1 string reference to 'EntityConditionGroupNormalizer'
jsonapi.services.yml in ./jsonapi.services.yml
jsonapi.services.yml
1 service uses EntityConditionGroupNormalizer
serializer.normalizer.entity_condition_group.jsonapi in ./jsonapi.services.yml
Drupal\jsonapi\Normalizer\EntityConditionGroupNormalizer

File

src/Normalizer/EntityConditionGroupNormalizer.php, line 13

Namespace

Drupal\jsonapi\Normalizer
View source
class EntityConditionGroupNormalizer implements DenormalizerInterface {

  /**
   * {@inheritdoc}
   */
  protected $supportedInterfaceOrClass = EntityConditionGroup::class;

  /**
   * {@inheritdoc}
   */
  protected $formats = [
    'api_json',
  ];

  /**
   * {@inheritdoc}
   */
  public function supportsDenormalization($data, $type, $format = NULL) {
    return $type === $this->supportedInterfaceOrClass;
  }

  /**
   * {@inheritdoc}
   */
  public function denormalize($data, $class, $format = NULL, array $context = []) {
    return new EntityConditionGroup($data['conjunction'], $data['members']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityConditionGroupNormalizer::$formats protected property
EntityConditionGroupNormalizer::$supportedInterfaceOrClass protected property
EntityConditionGroupNormalizer::denormalize public function Denormalizes data back into an object of the given class.
EntityConditionGroupNormalizer::supportsDenormalization public function Checks whether the given class is supported for denormalization by this normalizer.