Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "city".
- *
- * @property integer $id
- * @property string $locality
- * @property string $administrative_area_level_1
- * @property string $administrative_area_level_2
- * @property string $country
- * @property string $postal_code
- * @property string $latitude
- * @property string $longitude
- * @property string $place_id
- *
- * @property Profile[] $profiles
- */
- class City extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'city';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['country', 'locality'], 'required'],
- [['locality', 'administrative_area_level_1', 'administrative_area_level_2', 'country', 'postal_code', 'latitude', 'longitude', 'place_id'], 'string', 'max' => 45],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => Yii::t('app', 'ID'),
- 'locality' => Yii::t('app', 'Locality'),
- 'administrative_area_level_1' => Yii::t('app', 'Admin Area Level 1'),
- 'administrative_area_level_2' => Yii::t('app', 'Admin Area Level 2'),
- 'country' => Yii::t('app', 'Country'),
- 'postal_code' => Yii::t('app', 'Postal Code'),
- 'latitude' => Yii::t('app', 'Latitude'),
- 'longitude' => Yii::t('app', 'Longitude'),
- 'place_id' => Yii::t('app', 'Google Place ID'),
- ];
- }
- /**
- * @return \yii\db\ActiveQuery
- */
- public function getProfiles()
- {
- return $this->hasMany(Profile::className(), ['location' => 'id']);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment