Set the value of post code and city through a City instance.

@param City $city
429917
public function setCity(City $city): void
    {
        $this->city = $city->getName();
        $this->postCode = $city->getPostCode();
    }
1101345
public function cmdUpdateCity()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmitted('update', $params[0]);
        $this->validateComponent('city');

        $this->updateCity($params[0]);
        $this->output();
    }
1149504
protected function validateCity()
    {
        $id = $this->getUpdatingId();

        if ($id === false) {
            return null;
        }

        $data = $this->city->get($id);

        if (empty($data)) {
            $this->setErrorUnavailable('update', $this->translation->text('City'));
            return false;
        }

        $this->setUpdating($data);
        return true;
    }
1174045
public function city()
	{
		$requestParams = $this->initRequestParams('city');
		$this->request('city', $requestParams);

		return empty($this->error);
	}
246531
protected function setTitleEditCity()
    {
        if (isset($this->data_city['city_id'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_city['name']));
        } else {
            $title = $this->text('Add city');
        }

        $this->setTitle($title);
    }
663887
public function setData($timezone, $city, $region, $country)
    {
        $this->removeData();

        \Yii::$app->session[$this->timezoneSessionKey] = $timezone;
        $cookies = \Yii::$app->response->cookies;
        $cookies->add(new \yii\web\Cookie([
            'name' => $this->timezoneCookieName,
            'value' => $timezone,
            'expire' => time() + (int) $this->cookieDuration,
        ]));
        \Yii::$app->formatter->timeZone = $timezone;

        \Yii::$app->session[$this->citySessionKey] = $city;
        $cookies->add(new \yii\web\Cookie([
            'name' => $this->cityCookieName,
            'value' => $city,
            'expire' => time() + (int) $this->cookieDuration,
        ]));

        \Yii::$app->session[$this->regionSessionKey] = $region;
        $cookies->add(new \yii\web\Cookie([
            'name' => $this->regionCookieName,
            'value' => $region,
            'expire' => time() + (int) $this->cookieDuration,
        ]));

        \Yii::$app->session[$this->countrySessionKey] = $country;
        $cookies->add(new \yii\web\Cookie([
            'name' => $this->countryCookieName,
            'value' => $country,
            'expire' => time() + (int) $this->cookieDuration,
        ]));
    }
691483
func (s *ContactDetail) SetCity(v string) *ContactDetail {
	s.City = &v
	return s
}
652273
public function updateUserCity($user, $country, $city = null)
    {
        $this->getManager()->updateUserCity(
            $user->getId(),
            $country->getId(),
            $city !== null ? $city->getId() : null
        );
    }
1144563
public function setAllowPublicStatus($value)
    {
        $this->_validateNotNull('AllowPublicStatus', $value);
        $this->_validateInt('AllowPublicStatus', $value);

        if ($this->data['allow_public_status'] === $value) {
            return;
        }

        $this->data['allow_public_status'] = $value;

        $this->_setModified('allow_public_status');
    }
1035356
public function setAddress(\AgentSIB\Diadoc\Api\Proto\Address $value = null)
    {
        $this->Address = $value;
    }
1360999
func (s *EndpointLocation) SetCity(v string) *EndpointLocation {
	s.City = &v
	return s
}
1338320
public function setWarehouseCode( $code )
	{
		$this->_checkCode( $code );

		if ( $code == $this->getWarehouseCode() ) { return; }

		$this->_values['warehousecode'] = (string) $code;
		$this->setModified();
	}
429704
public function setShippingAddress(
        $postalCode = null,
        $street = null,
        $number = null,
        $complement = null,
        $district = null,
        $city = null,
        $state = null,
        $country = null
    ) {
        $param = $postalCode;
        if ($this->shipping == null) {
            $this->shipping = new PagSeguroShipping();
        }
        if (is_array($param)) {
            $this->shipping->setAddress(new PagSeguroAddress($param));
        } elseif ($param instanceof PagSeguroAddress) {
            $this->shipping->setAddress($param);
        } else {
            $address = new PagSeguroAddress();
            $address->setPostalCode($postalCode);
            $address->setStreet($street);
            $address->setNumber($number);
            $address->setComplement($complement);
            $address->setDistrict($district);
            $address->setCity($city);
            $address->setState($state);
            $address->setCountry($country);
            $this->shipping->setAddress($address);
        }
    }
986777
public function setData($value = null)
    {
        if ($value !== null && ! $value instanceof \Protobuf\Stream) {
            $value = \Protobuf\Stream::wrap($value);
        }

        $this->Data = $value;
    }
1014284
public function setPostcode(\Chill\MainBundle\Entity\PostalCode $postcode = null)
    {
        $this->postcode = $postcode;

        return $this;
    }
298507
public function setCity($city)
	{
		if ( $city == $this->getCity() ) { return; }

		$this->_values['city'] = (string) $city;
		$this->setModified();
	}
245016
public function setValue($value, $build)
    {
        $this->_value = (string) $value;
        if (isset($this->_name) && isset($this->_value)) {
            $build->setProperty($this->_name, $this->_value);
        }
    }