<?php
require_once "SiemensXMLElement.php";

class IppList extends SiemensXMLElement {
	
	const TypeImplicit = "IMPLICIT";
	const TypeExclusive = "EXCLUSIVE";
	const TypeMultiple = "MULTIPLE";
	
	private $columns="";
	private $type = null;
	
	public function __construct($type = IppList::TypeImplicit, $columns=1) {
		
		$attributes = array();
		$attributes["Type"] = $type;
		$attributes["Columns"] = $columns;
		
		parent::__construct($attributes);
	}
	
	protected function name() {
		return "IppList";
	}
	
	/**
	 * adds an option into the list. Please use this method instead of addUIElement directly, cause of the Count attribute!
	 * @param Option $option
	 */	
	public function addOption(Option $option) {
		
		$currentCount = @$this->attributes["Count"];
		$this->attributes["Count"] = (int) $currentCount + 1;

		$this->addUIElement($option);
		
	}
	
	
}