Skip to content

Commit

Permalink
Merge pull request #23 from kusiboss/feat/add-a-getter-for-an-action-
Browse files Browse the repository at this point in the history
add a getter for an action
  • Loading branch information
tuxes3 committed Nov 21, 2023
2 parents 7b36fe9 + a4c1b51 commit 33a9a19
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Table/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ public function getActions(): array
return $this->getInternalActions($this->actions);
}

public function getAction(string $acronym): ?\araise\CoreBundle\Action\Action
{
if (isset($this->actions[$acronym])) {
return $this->actions[$acronym];
}

return null;
}

/**
* @return Action[]
*/
Expand All @@ -254,6 +263,24 @@ public function addAction(string $acronym, array $options = [], $type = Action::
return $this;
}

public function removeAction(string $acronym): static
{
if (isset($this->actions[$acronym])) {
unset($this->actions[$acronym]);
}

return $this;
}

public function getBatchAction(string $acronym): ?\araise\CoreBundle\Action\Action
{
if (isset($this->batchActions[$acronym])) {
return $this->batchActions[$acronym];
}

return null;
}

public function addBatchAction(string $acronym, array $options = [], string $type = Action::class): static
{
if (! isset($options['voter_attribute'])) {
Expand Down

0 comments on commit 33a9a19

Please sign in to comment.