48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
class stAllegroBackendBreadcrumbsBuilder extends autoStAllegroBackendBreadcrumbsBuilder
|
|
{
|
|
protected $productBreadcrumbsBuilder;
|
|
|
|
public function initialize()
|
|
{
|
|
parent::initialize();
|
|
|
|
if ($this->relatedObject && $this->relatedObject instanceof Product)
|
|
{
|
|
stAdminGeneratorHelper::generate('stProduct');
|
|
|
|
$this->productBreadcrumbsBuilder = new stProductBreadcrumbsBuilder($this->context, $this->breadcrumbs, null, $this->forwardParameters);
|
|
}
|
|
}
|
|
|
|
public function getListBreadcrumbs()
|
|
{
|
|
if (null === $this->listBreadcrumbs)
|
|
{
|
|
if ($this->relatedObject && $this->relatedObject instanceof Product)
|
|
{
|
|
$this->defaultBreadcrumbs = $this->productBreadcrumbsBuilder->getEditBreadcrumbs($this->relatedObject);
|
|
}
|
|
|
|
parent::getListBreadcrumbs();
|
|
}
|
|
|
|
return $this->listBreadcrumbs;
|
|
}
|
|
|
|
public function getEditBreadcrumbs(AllegroApiOffer $allegroApiOffer)
|
|
{
|
|
if (null === $this->editBreadcrumbs)
|
|
{
|
|
if ($this->relatedObject && $this->relatedObject instanceof Product)
|
|
{
|
|
$this->defaultBreadcrumbs = $this->getListBreadcrumbs();
|
|
}
|
|
parent::getEditBreadcrumbs($allegroApiOffer);
|
|
}
|
|
|
|
return $this->editBreadcrumbs;
|
|
}
|
|
}
|