Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getDetailQueryWithoutArticles example
public
function
getOne
(
$id
)
{
$this
->
checkPrivilege
(
'read'
)
;
if
(
empty
(
$id
)
)
{
throw
new
ParameterMissingException
(
'id'
)
;
}
$query
=
$this
->
getRepository
(
)
->
getDetailQueryWithoutArticles
(
$id
)
;
$categoryResult
=
$query
->
getOneOrNullResult
(
$this
->
getResultMode
(
)
)
;
if
(
!
$categoryResult
)
{
throw
new
NotFoundException
(
sprintf
(
'Category by id %d not found',
$id
)
)
;
}
if
(
$this
->
getResultMode
(
)
=== Resource::HYDRATE_ARRAY
)
{
$category
=
$categoryResult
[
0
]
+
$categoryResult
;
$query
=
$this
->
getManager
(
)
->
createQuery
(
'SELECT shop FROM Shopware\Models\Shop\Shop as shop'
)
;