public function cityName() { $city = City::find($this->city); if ($city) { return $city->name; } return null; }
private function initCity() { if (!$this->type->isFinanceRequest() && !$this->type->isFeeRequest()) { return; } $inputData = $this->type->inputs(); $cityId = $inputData['city']; $this->city = City::find($cityId); if (!$this->city) { throw new ProcessorException(ProcessorException::RC_NO_SUCH_CITY); } }