public function add($object_id, $tag, $object_type = 'Ticket')
    {
        $this->clearError();

        $object_id = intval($object_id);
        if ( empty($object_id) ) {
            throw new \RuntimeException('Missing object ID');
        }

        if ( empty($tag) ) {
            throw new \RuntimeException('Missing tag');
        }

        $response = $this->getClient()->get(
            $this->getURL('add'),
            [
                'object' => $object_type,
                'o_id'   => $object_id,
                'item'   => $tag,
            ]
        );

        if ( $response->hasError() ) {
            $this->setError( $response->getError() );
        }

        return $this;
    }
public function add($object_id, $tag, $object_type = 'Ticket')
    {
        $this->clearError();

        $object_id = intval($object_id);
        if ( empty($object_id) ) {
            throw new \RuntimeException('Missing object ID');
        }

        if ( empty($tag) ) {
            throw new \RuntimeException('Missing tag');
        }

        $response = $this->getClient()->get(
            $this->getURL('add'),
            [
                'object' => $object_type,
                'o_id'   => $object_id,
                'item'   => $tag,
            ]
        );

        if ( $response->hasError() ) {
            $this->setError( $response->getError() );
        }

        return $this;
    }
public function add ( $ object_id , $ tag , $ object_type = 'Ticket' ) { $ this -> clearError ( ) ; $ object_id = intval ( $ object_id ) ; if ( empty ( $ object_id ) ) { throw new \ RuntimeException ( 'Missing object ID' ) ; } if ( empty ( $ tag ) ) { throw new \ RuntimeException ( 'Missing tag' ) ; } $ response = $ this -> getClient ( ) -> get ( $ this -> getURL ( 'add' ) , [ 'object' => $ object_type , 'o_id' => $ object_id , 'item' => $ tag , ] ) ; if ( $ response -> hasError ( ) ) { $ this -> setError ( $ response -> getError ( ) ) ; } return $ this ; }
Adds a tag to an object.

@param integer $object_id    ID of the object to fetch tags for.
@param string $tag           Tag to add.
@param string $object_type   Type of object to fetch tags for (e. g. 'Ticket').

@return object               This object.
Adds a tag to an object .