protected function checkIfPointLabelExists($label, $isMultiPoint)
    {
        $labelExists = false;
        $stack = ($isMultiPoint) ? $this->multiPointStack : $this->pointStack;
        foreach ($stack as $point)
        {
            if($point->getLabel() == $label)
            {
                $labelExists = true;
                break;
            }
        }

        if($labelExists)
        	throw new \InvalidArgumentException("label '" . $label . "' already exists, choose new point label.");
    }
protected function checkIfPointLabelExists($label, $isMultiPoint)
    {
        $labelExists = false;
        $stack = ($isMultiPoint) ? $this->multiPointStack : $this->pointStack;
        foreach ($stack as $point)
        {
            if($point->getLabel() == $label)
            {
                $labelExists = true;
                break;
            }
        }

        if($labelExists)
        	throw new \InvalidArgumentException("label '" . $label . "' already exists, choose new point label.");
    }
protected function checkIfPointLabelExists ( $ label , $ isMultiPoint ) { $ labelExists = false ; $ stack = ( $ isMultiPoint ) ? $ this -> multiPointStack : $ this -> pointStack ; foreach ( $ stack as $ point ) { if ( $ point -> getLabel ( ) == $ label ) { $ labelExists = true ; break ; } } if ( $ labelExists ) throw new \ InvalidArgumentException ( "label '" . $ label . "' already exists, choose new point label." ) ; }
Check if label already exists
Check if label already exists