Skip to content

Instantly share code, notes, and snippets.

@davidwindell
Created July 25, 2012 14:59
Show Gist options
  • 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