Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (2)
(feat): check if entity exists before mapping
· f151d290
Marcelo Rivera
authored
Jul 22, 2019
f151d290
(fix): send urn vs string when resolving boosted entity
· c1da061f
Marcelo Rivera
authored
Jul 22, 2019
c1da061f
Hide whitespace changes
Inline
Side-by-side
Core/Entities/Delegates/BoostCampaignResolverDelegate.php
View file @
c1da061f
...
...
@@ -75,11 +75,11 @@ class BoostCampaignResolverDelegate implements ResolverDelegate
*/
public
function
map
(
$urn
,
$campaign
)
{
if
(
!
$campaign
->
getEntityUrns
())
{
if
(
!
$campaign
||
!
$campaign
->
getEntityUrns
())
{
return
null
;
}
$entity
=
$this
->
resolver
->
setOpts
([
'ignoreAcl'
=>
true
])
->
single
(
$campaign
->
getEntityUrns
()[
0
]);
$entity
=
$this
->
resolver
->
setOpts
([
'ignoreAcl'
=>
true
])
->
single
(
new
Urn
(
$campaign
->
getEntityUrns
()[
0
])
)
;
$entity
->
boost
=
true
;
$entity
->
boosted_guid
=
$campaign
->
getGuid
();
$entity
->
urn
=
$campaign
->
getUrn
();
...
...
Core/Entities/Delegates/BoostGuidResolverDelegate.php
View file @
c1da061f
...
...
@@ -77,7 +77,7 @@ class BoostGuidResolverDelegate implements ResolverDelegate
*/
public
function
map
(
$urn
,
$entity
)
{
$boostedEntity
=
$entity
->
getEntity
();
$boostedEntity
=
$entity
?
$entity
->
getEntity
()
:
null
;
if
(
$boostedEntity
)
{
$boostedEntity
->
boosted
=
true
;
...
...