PoisonAppleGFX
New Member
it might sound stupid but i am having a hard time naming a function.My function returns the id of the tag with the given $name parameter; but it should create a new tag if it doesn't exist (and return the id of the new tag).Here is my code:\[code\]public function get_tag_insert_if_not_exists($name){ $tag = $this->get_tag_with_name($name); if ($tag === FALSE) { return $this->insert_tag($name); } return $tag->id;}\[/code\]