public function testFindByEntityCode()
 {
     $expected = new LocalHealthAuthority('Code', 'Name');
     $expected->setDateCreated($this->expectedDate);
     $returnedLHA = $this->instance->findByEntityCode($expected);
     $this->assertEquals($expected, $returnedLHA);
 }
 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());
 }
 /**
  * @VirtualProperty
  * @SerializedName("localHealthBoard")
  *
  * @return string
  */
 public function getLhaName()
 {
     if ($this->lha instanceof LocalHealthAuthority) {
         return $this->lha->getLocalAuthorityName();
     }
     return '';
 }
 /**
  * @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()));
 }