HosipLan

Untitled

Feb 27th, 2012
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.32 KB | None | 0 0
  1. $article = $articlesModel->find($id);
  2. $file = $article->getAttachement($filesModel, $name);
  3. $files = $article->getAttachement($filesModel);
  4.  
  5. public function getAttachement($filesModel, $name = NULL)
  6. {
  7.     if ($name) {
  8.         return $filesModel->find($this->id, $name);
  9.     } else {
  10.         return $fileSModel->findAll($this->id);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment