Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3101671
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3101671
Commits
b4c49241
Commit
b4c49241
authored
1 year ago
by
Andrei Mateescu
Browse files
Options
Downloads
Patches
Plain Diff
Modernize the QueryFactory class overrides.
parent
5bf58620
No related branches found
No related tags found
No related merge requests found
Pipeline
#108267
passed
1 year ago
Stage: 🏗️ Build
Stage: 🪄 Lint
Stage: 🗜️ Test
Pipeline: drupal-3101671
#108289
Pipeline: drupal-3101671
#108288
Pipeline: drupal-3101671
#108276
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php
+3
-44
3 additions, 44 deletions
.../modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php
core/modules/workspaces/src/EntityQuery/QueryFactory.php
+5
-30
5 additions, 30 deletions
core/modules/workspaces/src/EntityQuery/QueryFactory.php
with
8 additions
and
74 deletions
core/modules/workspaces/src/EntityQuery/PgsqlQueryFactory.php
+
3
−
44
View file @
b4c49241
...
@@ -2,52 +2,11 @@
...
@@ -2,52 +2,11 @@
namespace
Drupal\workspaces\EntityQuery
;
namespace
Drupal\workspaces\EntityQuery
;
use
Drupal\Core\Database\Connection
;
use
Drupal\Core\Entity\EntityTypeInterface
;
use
Drupal\Core\Entity\Query\QueryBase
;
use
Drupal\Core\Entity\Query\Sql\pgsql\QueryFactory
as
BaseQueryFactory
;
use
Drupal\workspaces\WorkspaceManagerInterface
;
/**
/**
* Workspaces PostgreSQL-specific entity query implementation.
* Workspaces PostgreSQL-specific entity query implementation.
*
* @internal
*/
*/
class
PgsqlQueryFactory
extends
BaseQueryFactory
{
class
PgsqlQueryFactory
extends
QueryFactory
{
/**
* The workspace manager.
*
* @var \Drupal\workspaces\WorkspaceManagerInterface
*/
protected
$workspaceManager
;
/**
* Constructs a PgsqlQueryFactory object.
*
* @param \Drupal\Core\Database\Connection $connection
* The database connection used by the entity query.
* @param \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager
* The workspace manager.
*/
public
function
__construct
(
Connection
$connection
,
WorkspaceManagerInterface
$workspace_manager
)
{
$this
->
connection
=
$connection
;
$this
->
workspaceManager
=
$workspace_manager
;
$this
->
namespaces
=
QueryBase
::
getNamespaces
(
$this
);
}
/**
* {@inheritdoc}
*/
public
function
get
(
EntityTypeInterface
$entity_type
,
$conjunction
)
{
$class
=
QueryBase
::
getClass
(
$this
->
namespaces
,
'Query'
);
return
new
$class
(
$entity_type
,
$conjunction
,
$this
->
connection
,
$this
->
namespaces
,
$this
->
workspaceManager
);
}
/**
* {@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
);
}
}
}
This diff is collapsed.
Click to expand it.
core/modules/workspaces/src/EntityQuery/QueryFactory.php
+
5
−
30
View file @
b4c49241
...
@@ -16,37 +16,12 @@
...
@@ -16,37 +16,12 @@
*/
*/
class
QueryFactory
extends
BaseQueryFactory
{
class
QueryFactory
extends
BaseQueryFactory
{
/**
public
function
__construct
(
* The workspace manager.
Connection
$connection
,
*
protected
readonly
WorkspaceManagerInterface
$workspaceManager
,
* @var \Drupal\workspaces\WorkspaceManagerInterface
protected
readonly
WorkspaceInformationInterface
$workspaceInfo
*/
)
{
protected
$workspaceManager
;
/**
* The workspace information service.
*
* @var \Drupal\workspaces\WorkspaceInformationInterface
*/
protected
$workspaceInfo
;
/**
* Constructs a QueryFactory object.
*
* Initializes the list of namespaces used to locate query
* classes for different entity types.
*
* @param \Drupal\Core\Database\Connection $connection
* The database connection used by the entity query.
* @param \Drupal\workspaces\WorkspaceManagerInterface $workspace_manager
* The workspace manager.
* @param \Drupal\workspaces\WorkspaceInformationInterface $workspace_information
* The workspace information service.
*/
public
function
__construct
(
Connection
$connection
,
WorkspaceManagerInterface
$workspace_manager
,
protected
WorkspaceInformationInterface
$workspace_information
)
{
$this
->
connection
=
$connection
;
$this
->
connection
=
$connection
;
$this
->
workspaceManager
=
$workspace_manager
;
$this
->
workspaceInfo
=
$workspace_information
;
$this
->
namespaces
=
QueryBase
::
getNamespaces
(
$this
);
$this
->
namespaces
=
QueryBase
::
getNamespaces
(
$this
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment