Maknz\Slack\AttachmentAction::setConfirm PHP Method

setConfirm() public method

public setConfirm ( ActionConfirmation | array $confirm ) : AttachmentAction
$confirm ActionConfirmation | array
return AttachmentAction
    public function setConfirm($confirm)
    {
        if ($confirm instanceof ActionConfirmation) {
            $this->confirm = $confirm;
            return $this;
        } elseif (is_array($confirm)) {
            $this->confirm = new ActionConfirmation($confirm);
            return $this;
        }
        throw new InvalidArgumentException('The action confirmation must be an instance of Maknz\\Slack\\ActionConfirmation or a keyed array');
    }