I've tried using the API class CompanyGenericTag
function called deleteCompanyGenericTag()
, but this only removes the tag from the database. Opening the employee in TimeTrex shows the tag is still there but orphaned.
// this code leaves an orphaned tag still associated with the user record
$ttAPI = new TimeTrexClientAPI( 'CompanyGenericTag' );
I've tried modifying the ['tag'] element of the array of data obtained from the getUser
function in the API class User
, but the tag still remains orphaned.
// this code does not remove a tag on the user record
$ttAPI = new TimeTrexClientAPI( 'User' );
$ttData = $ttAPI->getUser(null, true)->getResult();
$tagged_entry = $ttData;
$tagged_entry['tag'] = str_replace($tag_string,'',$tagged_entry['tag']);