Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getReferrerSearchTerms example
$result
->
getTotalCount
(
)
)
;
}
/** * @return void */
public
function
getReferrerSearchTermsAction
(
)
{
$selectedReferrer
=
(string)
$this
->
Request
(
)
->
getParam
(
'selectedReferrer'
)
;
$result
=
$this
->
getRepository
(
)
->
getReferrerSearchTerms
(
$selectedReferrer
)
;
$keywords
=
[
]
;
foreach
(
$result
->
getData
(
)
as
$data
)
{
preg_match_all
(
'#[?&]([qp]|query|highlight|encquery|url|field-keywords|as_q|sucheall|satitle|KW)=([^&\$]+)#',
utf8_encode
(
$data
[
'referrer'
]
)
. '&',
$matches
)
;
if
(
empty
(
$matches
[
0
]
)
)
{
continue
;
}
$ref
=
$matches
[
2
]
[
0
]
;
$ref
=
html_entity_decode
(
rawurldecode
(
strtolower
(
$ref
)
)
)
;
$ref
=
str_replace
(
'+', ' ',
$ref
)
;