Hello,
I have this class.
public function setElementLabel($options=array())
{
if (is_array($options))
{
if ($options['label'])
{
$this->label = $options['label'];
}
if (empty($this->label))
{
throw new Exception("Set element label");
}
return $this->label;
}
}
The problem is, that it is overwriting the next option, if that option isn't set. It is taking the previous option which is set. So it isn't giving a Exception also. What's wrong in my script?