wemersonrv

Untitled

Aug 12th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. Class MedicoRepository implements MedicoRepositoryInterface{
  2.  
  3.     public function hospitais($id){
  4.        
  5.         $h = array();
  6.         $medico = Medico::find($id);
  7.  
  8.         foreach($medico->postos as $posto)
  9.             $h[] = $posto->hospital->id;
  10.  
  11.         return Hospital::find( array_unique($h) );
  12.     }  
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment