| 1 |
<?php |
| 2 |
/** |
| 3 |
* MultipleFormElementValue.php |
| 4 |
* |
| 5 |
* The MultipleFormElementValue class file. |
| 6 |
* |
| 7 |
* PHP versions 5 |
| 8 |
* |
| 9 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 10 |
* @copyright 2008-2017 Alexander Schneider |
| 11 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 12 |
* @version SVN: $id$ |
| 13 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 14 |
*/ |
| 15 |
namespace UserAccessManager\Form; |
| 16 |
|
| 17 |
/** |
| 18 |
* Class MultipleFormElementValue |
| 19 |
* |
| 20 |
* @package UserAccessManager\Form |
| 21 |
*/ |
| 22 |
class MultipleFormElementValue extends ValueSetFormElementValue |
| 23 |
{ |
| 24 |
/** |
| 25 |
* @var FormElement |
| 26 |
*/ |
| 27 |
private $subElement; |
| 28 |
|
| 29 |
/** |
| 30 |
* @param FormElement $subElement |
| 31 |
* |
| 32 |
* @throws \Exception |
| 33 |
*/ |
| 34 |
public function setSubElement(FormElement $subElement) |
| 35 |
{ |
| 36 |
if ($subElement instanceof MultipleFormElement) { |
| 37 |
throw new \Exception('Invalid form type for sub element.'); |
| 38 |
} |
| 39 |
|
| 40 |
$this->subElement = $subElement; |
| 41 |
} |
| 42 |
|
| 43 |
/** |
| 44 |
* @return FormElement |
| 45 |
*/ |
| 46 |
public function getSubElement() |
| 47 |
{ |
| 48 |
return $this->subElement; |
| 49 |
} |
| 50 |
} |
| 51 |
|