/**
  * Returns the table name of the Location model. You can override this 
  * method in order to provide a custom table name.
  * 
  * @return string
  */
 protected function getLocationTableName()
 {
     return Location::tableName();
 }
 /**
  * @inheritdoc
  */
 public function getLocation()
 {
     return $this->hasOne(Location::className(), ['id' => 'location_id']);
 }
示例#3
0
 /**
  * 
  * @return yii\db\ActiveQuery
  */
 public function getLocations()
 {
     return $this->hasMany(Location::className(), ['region_id' => 'id']);
 }