Skip to content

Instantly share code, notes, and snippets.

@davidwindell
Created July 25, 2012 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidwindell/3176614 to your computer and use it in GitHub Desktop.
Save davidwindell/3176614 to your computer and use it in GitHub Desktop.
<?php
public function setPosts(array $posts) {
foreach ($posts as $post) {
if ($this->posts->contains($post)) {
return;
}
$this->posts->add($post);
$post->setTicket($this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment