public function removeElement($element) { $key = array_search($element, $this->elements, true); if ($key === false) { return false; } unset($this->elements[$key]); return true; }
/** * @param Deputy $deputy * @return HasDeputiesInterface */ public function removeDeputy(Deputy $deputy) { if (true === $this->hasDeputy($deputy)) { $this->deputies->removeElement($deputy); } return $this; }