public function Add(IElement $toBeAdded) { foreach ($this->GetAll() as $input) { if ($toBeAdded->IsSame($input)) { throw new ElementExistsException("Input with name " . $toBeAdded->GetName() . " already exist!"); } } $this->input[$toBeAdded->GetName()] = $toBeAdded; }
public function IsSame(IElement $element) { return $this->name == $element->GetName(); }