public function addTag($tagName, $tagValue)
    {
        if (!isset($this->tags)) {
            $this->tags = [];
        }

        // The same tag cannot be added 2 times
        if (array_key_exists($tagName, $this->tags)) {
            throw new PushwooshException(
                'The tag \'' . $tagName .
                '\' has already been added, use the \'setTag\' method if you want to overwrite its value !'
            );
        }

        $this->tags[$tagName] = $tagValue;
    }
public function addTag($tagName, $tagValue)
    {
        if (!isset($this->tags)) {
            $this->tags = [];
        }

        // The same tag cannot be added 2 times
        if (array_key_exists($tagName, $this->tags)) {
            throw new PushwooshException(
                'The tag \'' . $tagName .
                '\' has already been added, use the \'setTag\' method if you want to overwrite its value !'
            );
        }

        $this->tags[$tagName] = $tagValue;
    }
public function addTag ( $ tagName , $ tagValue ) { if ( ! isset ( $ this -> tags ) ) { $ this -> tags = [ ] ; } // The same tag cannot be added 2 times if ( array_key_exists ( $ tagName , $ this -> tags ) ) { throw new PushwooshException ( 'The tag \'' . $ tagName . '\' has already been added, use the \'setTag\' method if you want to overwrite its value !' ) ; } $ this -> tags [ $ tagName ] = $ tagValue ; }
Add a new tag to the Pushwoosh tags.

<p>NOTE: This function cannot be used to overwrite an existing tag, use the '#setTag($tagName, $tagValue)'
function if you want to overwrite a tag.</p>

@param string $tagName  the name of the tag to add or update.
@param mixed  $tagValue the value of the tag to set.

@throws \Gomoob\Pushwoosh\Exception\PushwooshException if a tag having the specified name has already been added.
Add a new tag to the Pushwoosh tags .