-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add event to modify buttons in backend module (#592)
* [TASK] Add event to modify buttons in backend module * [TASK] Reduce get*ButtonButtons in OrderController to one method * [TASK] Add documentation for the new event Related: #588
- Loading branch information
Showing
8 changed files
with
317 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
Classes/Event/Template/Components/ModifyButtonBarEvent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Extcode\Cart\Event\Template\Components; | ||
|
||
/* | ||
* This file is part of the package extcode/cart. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
use Extcode\Cart\Domain\Model\Order\Item; | ||
use TYPO3\CMS\Extbase\Mvc\RequestInterface; | ||
|
||
final class ModifyButtonBarEvent | ||
{ | ||
private array $buttons = []; | ||
|
||
public function __construct( | ||
private readonly RequestInterface $request, | ||
private readonly array $settings, | ||
private readonly array $searchArguments, | ||
private readonly ?Item $orderItem = null, | ||
) {} | ||
|
||
public function getRequest(): RequestInterface | ||
{ | ||
return $this->request; | ||
} | ||
|
||
public function getSettings(): array | ||
{ | ||
return $this->settings; | ||
} | ||
|
||
public function getSearchArguments(): array | ||
{ | ||
return $this->searchArguments; | ||
} | ||
|
||
public function getOrderItem(): ?Item | ||
{ | ||
return $this->orderItem; | ||
} | ||
|
||
public function getButtons(): array | ||
{ | ||
return $this->buttons; | ||
} | ||
|
||
public function setButtons(array $buttons): void | ||
{ | ||
$this->buttons = $buttons; | ||
} | ||
} |
Oops, something went wrong.