getAction() public method

Get information about an action.
public getAction ( string $cabin, integer $actionId ) : array
$cabin string
$actionId integer
return array
Esempio n. 1
0
 /**
  * @route crew/permissions/{string}/action/{id}
  *
  * @param string $cabin
  * @param string $actionId
  */
 public function editAction(string $cabin, string $actionId)
 {
     $actionId = (int) $actionId;
     if (!\in_array($cabin, $this->getCabinNamespaces())) {
         \Airship\redirect($this->airship_cabin_prefix . '/crew/permissions');
     }
     $post = $this->post(new SaveActionFilter());
     $action = $this->perms->getAction($cabin, $actionId);
     if (empty($action)) {
         \Airship\redirect($this->airship_cabin_prefix . '/crew/permissions/' . $cabin);
     }
     if (!empty($post)) {
         if ($this->perms->saveAction($cabin, $actionId, $post)) {
             \Airship\redirect($this->airship_cabin_prefix . '/crew/permissions/' . $cabin);
         }
     }
     $this->lens('perms/action', ['action' => $action]);
 }