public function addAction(Action $action): Editbox
    {

        switch ($action->getType()) {
            case Action::SAVE:
                $this->actions[0] = $action;
                break;

            case Action::CANCEL:
                $this->actions[1] = $action;
                break;

            case Action::CONTEXT:
            default:
                if (empty($this->actions[2])) {
                    $this->actions[2] = [];
                }

                $this->actions[2][] = $action;

                break;

        }

        return $this;
    }
public function addAction(Action $action): Editbox
    {

        switch ($action->getType()) {
            case Action::SAVE:
                $this->actions[0] = $action;
                break;

            case Action::CANCEL:
                $this->actions[1] = $action;
                break;

            case Action::CONTEXT:
            default:
                if (empty($this->actions[2])) {
                    $this->actions[2] = [];
                }

                $this->actions[2][] = $action;

                break;

        }

        return $this;
    }
public function addAction ( Action $ action ) : Editbox { switch ( $ action -> getType ( ) ) { case Action :: SAVE : $ this -> actions [ 0 ] = $ action ; break ; case Action :: CANCEL : $ this -> actions [ 1 ] = $ action ; break ; case Action :: CONTEXT : default : if ( empty ( $ this -> actions [ 2 ] ) ) { $ this -> actions [ 2 ] = [ ] ; } $ this -> actions [ 2 ] [ ] = $ action ; break ; } return $ this ; }
Adds an action link to actions list

@param Action $action

@return Editbox
Adds an action link to actions list