public function testGetSetWebsite() { $expected = uniqid('WEBSITE '); $this->assertEmpty($this->instance->getWebsite()); $this->assertInstanceOf(DistrictCouncil::class, $this->instance->setWebsite($expected)); $this->assertEquals($expected, $this->instance->getWebsite()); }
/** * @VirtualProperty * @SerializedName("website") * * @return string */ public function getWebsite() { if ($this->districtCouncil instanceof DistrictCouncil) { return $this->districtCouncil->getWebsite(); } return ''; }
/** * @param DistrictCouncil $districtCouncil * @return DistrictCouncil */ public function saveWebsite(DistrictCouncil $districtCouncil) { /** @var DistrictCouncil $instance */ $instance = $this->entityManager->getRepository('TransformCore\\PHE\\LocalHealthAuthorityBundle\\Entity\\DistrictCouncil')->findOneBy(array('id' => $districtCouncil->getId())); if ($instance instanceof DistrictCouncil) { $instance->setWebsite($districtCouncil->getWebsite()); $this->save($instance); return $instance; } return new DistrictCouncil('', ''); }