Exemplo n.º 1
0
 /**
  * getPatient
  *
  * @param $id $id
  *        	int
  *        	
  * @return Patient Patient
  */
 public static function getPatient($id, $type = '')
 {
     $entityManager = (object) DoctrineBootstrap::getEntityManager();
     $type = 'Hospitalplugin\\Entities\\Patient' . $type;
     $patient = $entityManager->getRepository($type)->findOneBy(array('id' => $id));
     return Utils::cast($type, (object) $patient, 0);
 }
Exemplo n.º 2
0
 function testCast()
 {
     $d = new DateTime();
     $this->assertEquals(Utils::cast('\\DateTime', $d), $d);
 }