Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TYPO3
languagevisibility
Commits
2c71d063
Commit
2c71d063
authored
Jul 22, 2020
by
Kevin Ditscheid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TASK] Remove ObjectManager usages
parent
35e57b9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Classes/Xclass/Typo3DbBackend.php
Classes/Xclass/Typo3DbBackend.php
+7
-7
No files found.
Classes/Xclass/Typo3DbBackend.php
View file @
2c71d063
...
...
@@ -30,9 +30,10 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
use
TYPO3\CMS\Core\Context\Context
;
use
TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
;
use
TYPO3\CMS\Core\Context\WorkspaceAspect
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Extbase\Persistence\Generic\Query
;
use
TYPO3\CMS\Extbase\Persistence\QueryInterface
;
use
TYPO3\CMS\
Frontend\Page
\PageRepository
;
use
TYPO3\CMS\
Core\Domain\Repository
\PageRepository
;
use
TYPO3\CMS\Extbase\Persistence\Generic\Qom
;
use
TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface
;
use
TYPO3\Languagevisibility\Service\FrontendServices
;
...
...
@@ -67,9 +68,8 @@ class Typo3DbBackend extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo
return
$rows
;
}
$context
=
$this
->
objectManager
->
get
(
Context
::
class
);
$pageRepository
=
$this
->
objectManager
->
get
(
PageRepository
::
class
,
$context
);
$context
=
GeneralUtility
::
makeInstance
(
Context
::
class
);
$pageRepository
=
GeneralUtility
::
makeInstance
(
PageRepository
::
class
,
$context
);
$overlaidRows
=
[];
foreach
(
$rows
as
$row
)
{
...
...
@@ -192,16 +192,16 @@ class Typo3DbBackend extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo
return
$rows
;
}
$context
=
$this
->
objectManager
->
get
(
Context
::
class
);
$context
=
GeneralUtility
::
makeInstance
(
Context
::
class
);
if
(
$workspaceUid
===
NULL
)
{
$workspaceUid
=
$context
->
getPropertyFromAspect
(
'workspace'
,
'id'
);
}
else
{
// A custom query is needed, so a custom context is cloned
$workspaceUid
=
(
int
)
$workspaceUid
;
$context
=
clone
$context
;
$context
->
setAspect
(
'workspace'
,
$this
->
objectManager
->
get
(
WorkspaceAspect
::
class
,
$workspaceUid
));
$context
->
setAspect
(
'workspace'
,
GeneralUtility
::
makeInstance
(
WorkspaceAspect
::
class
,
$workspaceUid
));
}
$pageRepository
=
$this
->
objectManager
->
get
(
PageRepository
::
class
,
$context
);
$pageRepository
=
GeneralUtility
::
makeInstance
(
PageRepository
::
class
,
$context
);
// Fetches the move-placeholder in case it is supported
// by the table and if there's only one row in the result set
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment