src/delivery/web/adapters/curir/CurirBreadCrumbsTrail.php 1 location
|
@@ 44-52 (lines=9) @@
|
| 41 |
|
* @param BreadCrumb[] $crumbs |
| 42 |
|
* @return BreadCrumb[] |
| 43 |
|
*/ |
| 44 |
|
private function saveCrumbs($crumbs) { |
| 45 |
|
$this->cookies->create(new Cookie(array_map(function (BreadCrumb $crumb) { |
| 46 |
|
return [ |
| 47 |
|
'caption' => $crumb->getCaption(), |
| 48 |
|
'target' => $crumb->getTarget() |
| 49 |
|
]; |
| 50 |
|
}, $crumbs)), self::COOKIE_KEY); |
| 51 |
|
return $crumbs; |
| 52 |
|
} |
| 53 |
|
} |
src/delivery/web/adapters/silex/SilexBreadCrumbsTrail.php 1 location
|
@@ 38-45 (lines=8) @@
|
| 35 |
|
}, $serialized); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function getCookie() { |
| 39 |
|
return new Cookie(self::COOKIE_NAME, json_encode(array_map(function (BreadCrumb $crumb) { |
| 40 |
|
return [ |
| 41 |
|
'target' => $crumb->getTarget(), |
| 42 |
|
'caption' => $crumb->getCaption() |
| 43 |
|
]; |
| 44 |
|
}, $this->getCrumbs()))); |
| 45 |
|
} |
| 46 |
|
} |