Define class Conditions as a service

Created on 10 May 2024, 6 months ago

Problem/Motivation

When trying to override for example the Conditions:apply() in a custom module, it's not possible because it's called from the Transformers class. Other classes are also defined as services so why not Conditions too.

Proposed resolution

Define the Conditions as a service and use it in the Transformer constructor so that it can be called from the class instance instead of statically.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇫🇮Finland merilainen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @merilainen
  • Status changed to Needs review 6 months ago
  • 🇫🇮Finland merilainen

    Define the Conditions class as a Drupal service

    - Transformers class will use Conditions in its constructor
    - Change itemsToSchema() to non-static
    - Call the apply() with $this->conditions->apply($schema, $items); in itemsToSchema()

  • Issue was unassigned.
Production build 0.71.5 2024