public function testFindByEntityCode()
 {
     $expected = new ElectoralWard('Code', 'Name');
     $expected->setDateCreated($this->expectedDate);
     $returnedWard = $this->instance->findByEntityCode($expected);
     $this->assertEquals($expected, $returnedWard);
 }
 public function testGetSetElectoralWardName()
 {
     $expected = uniqid('Ward ');
     $this->assertEmpty($this->instance->getElectoralWardName());
     $this->assertInstanceOf(ElectoralWard::class, $this->instance->setElectoralWardName($expected));
     $this->assertEquals($expected, $this->instance->getElectoralWardName());
 }
Пример #3
0
 /**
  * @VirtualProperty
  * @SerializedName("electoralWard")
  *
  * @return string
  */
 public function getElectoralWardName()
 {
     if ($this->electoralWard instanceof ElectoralWard) {
         return $this->electoralWard->getElectoralWardName();
     }
     return '';
 }
 /**
  * @param ElectoralWard $electoralWard
  * @return null|object
  */
 public function findByEntityCode(ElectoralWard $electoralWard)
 {
     return $this->entityManager->getRepository('TransformCore\\PHE\\LocalHealthAuthorityBundle\\Entity\\ElectoralWard')->findOneBy(array('entityCode' => $electoralWard->getEntityCode()));
 }
 /**
  * @param ElectoralWard $electoralWard
  * @return array<ElectoralWard>
  */
 public function findElectoralWardByNameAndEntityCode(ElectoralWard $electoralWard)
 {
     return $this->findBy(array('entityCode' => $electoralWard->getEntityCode(), 'electoralWardName' => $electoralWard->getElectoralWardName()));
 }