Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
translateOnlyOfType example
public
function
getPseudoClassTranslators
(
)
: array
{
return
[
'root' =>
$this
->
translateRoot
(
...
)
,
'scope' =>
$this
->
translateScopePseudo
(
...
)
,
'first-child' =>
$this
->
translateFirstChild
(
...
)
,
'last-child' =>
$this
->
translateLastChild
(
...
)
,
'first-of-type' =>
$this
->
translateFirstOfType
(
...
)
,
'last-of-type' =>
$this
->
translateLastOfType
(
...
)
,
'only-child' =>
$this
->
translateOnlyChild
(
...
)
,
'only-of-type' =>
$this
->
translateOnlyOfType
(
...
)
,
'empty' =>
$this
->
translateEmpty
(
...
)
,
]
;
}
public
function
translateRoot
(
XPathExpr
$xpath
)
: XPathExpr
{
return
$xpath
->
addCondition
(
'not(parent::*)'
)
;
}
public
function
translateScopePseudo
(
XPathExpr
$xpath
)
: XPathExpr
{