public function testFindByEntityCode()
 {
     $expected = new LocalHealthAuthority('Code', 'Name');
     $expected->setDateCreated($this->expectedDate);
     $returnedLHA = $this->instance->findByEntityCode($expected);
     $this->assertEquals($expected, $returnedLHA);
 }
コード例 #2
0
 public function testGetSetLocalHealthAuthorityName()
 {
     $expected = uniqid('LHA Name');
     $this->assertEmpty($this->instance->getLocalAuthorityName());
     $this->assertInstanceOf(LocalHealthAuthority::class, $this->instance->setLocalAuthorityName($expected));
     $this->assertEquals($expected, $this->instance->getLocalAuthorityName());
 }
コード例 #3
0
 /**
  * @VirtualProperty
  * @SerializedName("localHealthBoard")
  *
  * @return string
  */
 public function getLhaName()
 {
     if ($this->lha instanceof LocalHealthAuthority) {
         return $this->lha->getLocalAuthorityName();
     }
     return '';
 }
コード例 #4
0
 /**
  * @param LocalHealthAuthority $localHealthAuthority
  * @return null|object
  */
 public function findByEntityCode(LocalHealthAuthority $localHealthAuthority)
 {
     return $this->entityManager->getRepository('TransformCore\\PHE\\LocalHealthAuthorityBundle\\Entity\\LocalHealthAuthority')->findOneBy(array('entityCode' => $localHealthAuthority->getEntityCode()));
 }
 /**
  * @param LocalHealthAuthority $lha
  * @return array<LocalHealthAuthority>
  */
 public function findLhaByNameAndEntityCode(LocalHealthAuthority $lha)
 {
     return $this->findBy(array('entityCode' => $lha->getEntityCode(), 'localAuthorityName' => $lha->getLocalAuthorityName()));
 }