public function getUniqueCounterValue($text, $isRootLevel = true)
    {
        if ($isRootLevel) {
            foreach ($this->configuration['reservedNames'] as $reservedName) {
                // Case insensitive comparison
                if (strcasecmp($text, $reservedName) === 0) {
                    return 2;
                }
            }
        }

        return 1;
    }
public function getUniqueCounterValue($text, $isRootLevel = true)
    {
        if ($isRootLevel) {
            foreach ($this->configuration['reservedNames'] as $reservedName) {
                // Case insensitive comparison
                if (strcasecmp($text, $reservedName) === 0) {
                    return 2;
                }
            }
        }

        return 1;
    }
public function getUniqueCounterValue ( $ text , $ isRootLevel = true ) { if ( $ isRootLevel ) { foreach ( $ this -> configuration [ 'reservedNames' ] as $ reservedName ) { // Case insensitive comparison if ( strcasecmp ( $ text , $ reservedName ) === 0 ) { return 2 ; } } } return 1 ; }
Returns unique counter number that is appended to the path element in order to make it unique
against system reserved names and other entries on the same level.

Comparison is done only if given $isRootLevel equals to true (it does by default), meaning that
entry is at first level of URL.
In a case when reserved name is matched method will return 2.
When given $isRootLevel equals to false or when there is no match with reserved names this will
return 1, which is default value not appended to name.

Note: this is used only when publishing URL aliases, when creating global and custom aliases user
is allowed to create first level entries that collide with reserved names. Also, in actual creation
of the alias name will be further checked against existing elements under the same parent, using
unique counter value determined here as starting unique counter value.

@param string $text
@param bool $isRootLevel

@return int
Returns unique counter number that is appended to the path element in order to make it unique against system reserved names and other entries on the same level .