0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-02-28 10:33:43 +00:00
nextcloud_server/apps/user_ldap/lib/WizardResult.php

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1 KiB
PHP
Raw Permalink Normal View History

<?php
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
* SPDX-License-Identifier: AGPL-3.0-only
*/
2016-05-12 14:08:46 +00:00
namespace OCA\User_LDAP;
class WizardResult {
protected $changes = [];
protected $options = [];
protected $markedChange = false;
/**
2014-05-13 11:29:25 +00:00
* @param string $key
* @param mixed $value
*/
public function addChange($key, $value) {
$this->changes[$key] = $value;
}
public function markChange() {
$this->markedChange = true;
}
/**
* @param string $key
2014-04-16 15:54:10 +00:00
* @param array|string $values
*/
public function addOptions($key, $values) {
if (!is_array($values)) {
$values = [$values];
}
$this->options[$key] = $values;
}
/**
* @return bool
*/
public function hasChanges() {
return (count($this->changes) > 0 || $this->markedChange);
}
/**
* @return array
*/
public function getResultArray() {
$result = [];
$result['changes'] = $this->changes;
if (count($this->options) > 0) {
$result['options'] = $this->options;
}
return $result;
}
2014-05-13 11:29:25 +00:00
}