saveAction() public method

Update the label for a given action.
public saveAction ( string $cabin, integer $actionId, array $post = [] ) : boolean
$cabin string
$actionId integer
$post array
return boolean
コード例 #1
0
ファイル: Permissions.php プロジェクト: paragonie/airship
 /**
  * @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]);
 }