Last active
August 11, 2022 16:38
-
-
Save ozin7/16227d2276be19d8713f76b031b02ab1 to your computer and use it in GitHub Desktop.
Drupal 8: Override service methods(service decorator)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workspaces.entity.query.sql: | |
decorates: entity.query.sql | |
class: Drupal\workspaces\EntityQuery\QueryFactory | |
arguments: | |
- '@database' | |
- '@workspaces.manager' | |
public: false | |
decoration_priority: 50 | |
tags: | |
- { name: backend_overridable } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Workspaces-specific entity query implementation. | |
*/ | |
class QueryFactory extends BaseQueryFactory { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getAggregate(EntityTypeInterface $entity_type, $conjunction) { | |
$class = QueryBase::getClass($this->namespaces, 'QueryAggregate'); | |
return new $class($entity_type, $conjunction, $this->connection, $this->namespaces, $this->workspaceManager); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment