Skip to content

Commit

Permalink
added display_mode to category response
Browse files Browse the repository at this point in the history
  • Loading branch information
matesich committed Jan 11, 2023
1 parent 7b5d4bc commit 5c96d1d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Controller/Pwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ class Pwa extends Action implements HttpGetActionInterface, HttpPostActionInterf
*/
protected $name;

/**
* @var string
*/
protected $display_mode;

/**
* @var string
*/
Expand Down Expand Up @@ -131,6 +136,16 @@ public function setName(string $name): self
return $this;
}

/**
* @param string $display_mode
* @return Pwa
*/
public function setDisplayMode(string $display_mode): self
{
$this->display_mode = $display_mode;
return $this;
}

/**
* @param string $identifier
* @return Pwa
Expand Down Expand Up @@ -176,6 +191,7 @@ public function __construct(
$this->id = '';
$this->sku = '';
$this->name = '';
$this->display_mode = '';
$this->identifier = '';
$this->description = '';
$this->catalogDefaultSortBy = '';
Expand All @@ -197,6 +213,7 @@ public function execute()
$resultLayout->setSku($this->sku);
$resultLayout->setName($this->name);
$resultLayout->setIdentifier($this->identifier);
$resultLayout->setDisplayMode($this->display_mode);
$resultLayout->setDescription($this->description);
$resultLayout->setCatalogDefaultSortBy($this->catalogDefaultSortBy);
try{
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ protected function setResponseCategory($id, ActionInterface $action)

$action->setId($category->getId() ?? '');
$action->setName($category->getName() ?? '');
$action->setDisplayMode($category->getDisplayMode() ?? '');
$action->setDescription($category->getDescription() ?? '');
} catch (NoSuchEntityException $e) {
$this->setNotFound($action);
Expand Down
21 changes: 21 additions & 0 deletions src/View/Result/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ class Page extends ExtendedPage
*/
protected $name;

/**
* @var string
*/
protected $display_mode;

/**
* @var string
*/
Expand Down Expand Up @@ -174,6 +179,7 @@ public function __construct(
$this->id = '';
$this->sku = '';
$this->name = '';
$this->display_mode = '';
$this->identifier = '';
$this->description = '';
$this->catalogDefaultSortBy = '';
Expand Down Expand Up @@ -250,6 +256,21 @@ public function getName()
return $this->name;
}

public function setDisplayMode(string $display_mode)
{
if($this->display_mode === '') {
$this->display_mode = $display_mode;
return $this;
}

return '';
}

public function getDisplayMode()
{
return $this->display_mode;
}

public function setIdentifier(string $identifier)
{
if($this->identifier === '') {
Expand Down

0 comments on commit 5c96d1d

Please sign in to comment.