private function getLatestPeriod(GameMode $gameMode)
 {
     $o = PeriodMap::find()->andWhere(['in', 'rule_id', array_map(function ($a) {
         return $a->id;
     }, $gameMode->rules)])->orderBy('{{period_map}}.[[period]] DESC')->limit(1)->one();
     return $o ? $o->period : 0;
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPeriodMaps()
 {
     return $this->hasMany(PeriodMap::className(), ['map_id' => 'id']);
 }