Added tag modification from the user interface
This commit is contained in:
@@ -93,6 +93,29 @@ class TagModel extends Base
|
||||
->findOneColumn('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the tag exists
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @param string $tag
|
||||
* @param integer $tag_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function exists($project_id, $tag, $tag_id = 0)
|
||||
{
|
||||
return $this->db
|
||||
->table(self::TABLE)
|
||||
->neq('id', $tag_id)
|
||||
->beginOr()
|
||||
->eq('project_id', 0)
|
||||
->eq('project_id', $project_id)
|
||||
->closeOr()
|
||||
->ilike('name', $tag)
|
||||
->asc('project_id')
|
||||
->exists();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return tag id and create a new tag if necessary
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user