Skip to content

Instantly share code, notes, and snippets.

@sorbing
Created November 5, 2012 13:12
Show Gist options
  • Save sorbing/4017129 to your computer and use it in GitHub Desktop.
Save sorbing/4017129 to your computer and use it in GitHub Desktop.
public function addTag(Tag $tag)
{
if ($this->collTags === null) {
$this->initTags();
}
if (!$this->collTags->contains($tag))
{
// ~~~
if ($tag->getId()) {
$tag = TagQuery::create()->findOneById($tag->getId());
}
// ~~~
$this->doAddTag($tag);
$this->collTags[]= $tag;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment