Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace makspass\entities;
- use Yii;
- /**
- * This is the model class for table "{{%city}}".
- *
- * @property integer $id
- * @property string $name
- * @property string $alias
- * @property string $geo_lat
- * @property string $geo_lon
- * @property integer $zoom
- *
- * @property Studio[] $studios
- */
- class City extends \yii\db\ActiveRecord
- {
- /* TODO:: Сделать актуальный город*/
- /**
- * @inheritdoc
- * @return void
- */
- public static function tableName()
- {
- return '{{%city}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['name', 'alias', 'geo_lat', 'geo_lon'], 'required'],
- [['geo_lat', 'geo_lon'], 'number'],
- [['zoom', 'club_count'], 'integer'],
- [['name', 'alias'], 'string', 'max' => 255],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Name',
- 'alias' => 'Alias',
- 'geo_lat' => 'geo_lat',
- 'geo_lon' => 'geo_lon',
- 'zoom' => 'zoom',
- ];
- }
- /**
- * @return \yii\db\ActiveQuery
- */
- public function getStudios()
- {
- return $this->hasMany(Studio::className(), ['city_id' => 'id']);
- }
- /**
- * @inheritdoc
- * @return \makspass\entities\query\CityQuery the active query used by this AR class.
- */
- public static function find()
- {
- return new \makspass\entities\query\CityQuery(get_called_class());
- }
- }
Add Comment
Please, Sign In to add comment