private function makeDeathReason($type_key, $table)
 {
     $typeId = DeathReasonType::findOne(['key' => $type_key])->id;
     $select = "SELECT {$typeId} AS [[type_id]], [[key]], [[name]] FROM {{{$table}}} ORDER BY [[id]]";
     $sql = "INSERT INTO {{death_reason}} ( [[type_id]], [[key]], [[name]] ) " . $select;
     $this->execute($sql);
 }
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'slosher'])->id, 'key' => 'hissen_hue', 'name' => 'Tri-Slosher Nouveau', 'subweapon_id' => Subweapon::findOne(['key' => 'chasebomb'])->id, 'special_id' => Special::findOne(['key' => 'supersensor'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'hissen_hue', 'name' => 'Tri-Slosher Nouveau']);
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'rapid_elite_deco', 'name' => 'Rapid Blaster Pro Deco', 'subweapon_id' => Subweapon::findOne(['key' => 'poison'])->id, 'special_id' => Special::findOne(['key' => 'megaphone'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'rapid_elite_deco', 'name' => 'Rapid Blaster Pro Deco']);
 }
Exemplo n.º 3
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'nova_neo', 'name' => 'Luna Blaster Neo', 'subweapon_id' => Subweapon::findOne(['key' => 'splashbomb'])->id, 'special_id' => Special::findOne(['key' => 'bombrush'])->id]);
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'h3reelgun_d', 'name' => 'H-3 Nozzlenose D', 'subweapon_id' => Subweapon::findOne(['key' => 'pointsensor'])->id, 'special_id' => Special::findOne(['key' => 'supershot'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'nova_neo', 'name' => 'Luna Blaster Neo']);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'h3reelgun_d', 'name' => 'H-3 Nozzlenose D']);
 }
Exemplo n.º 4
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'charger'])->id, 'key' => 'liter3k_scope_custom', 'name' => 'Custom E-liter 3K Scope', 'subweapon_id' => Subweapon::findOne(['key' => 'jumpbeacon'])->id, 'special_id' => Special::findOne(['key' => 'daioika'])->id]);
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'longblaster_custom', 'name' => 'Custom Range Blaster', 'subweapon_id' => Subweapon::findOne(['key' => 'splashbomb'])->id, 'special_id' => Special::findOne(['key' => 'daioika'])->id]);
     $mainWeapon = DeathReasonType::findOne(['key' => 'main'])->id;
     $this->batchInsert('death_reason', ['type_id', 'key', 'name'], [[$mainWeapon, 'liter3k_scope_custom', 'Custom E-liter 3K Scope'], [$mainWeapon, 'longblaster_custom', 'Custom Range Blaster']]);
 }
Exemplo n.º 5
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'splatling'])->id, 'key' => 'barrelspinner_deco', 'name' => 'Heavy Splatling Deco', 'subweapon_id' => Subweapon::findOne(['key' => 'pointsensor'])->id, 'special_id' => Special::findOne(['key' => 'daioika'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'barrelspinner_deco', 'name' => 'Heavy Splatling Deco']);
 }
Exemplo n.º 6
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'splatling'])->id, 'key' => 'hydra', 'name' => 'Hydra Splatling', 'subweapon_id' => Subweapon::findOne(['key' => 'splashbomb'])->id, 'special_id' => Special::findOne(['key' => 'supersensor'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'hydra', 'name' => 'Hydra Splatling']);
 }
Exemplo n.º 7
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'slosher'])->id, 'key' => 'bucketslosher_deco', 'name' => 'Slosher Deco', 'subweapon_id' => Subweapon::findOne(['key' => 'splashshield'])->id, 'special_id' => Special::findOne(['key' => 'daioika'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'bucketslosher_deco', 'name' => 'Slosher Deco']);
 }
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'roller'])->id, 'key' => 'hokusai_hue', 'name' => 'Octobrush Nouveau', 'subweapon_id' => Subweapon::findOne(['key' => 'splashbomb'])->id, 'special_id' => Special::findOne(['key' => 'supershot'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'hokusai_hue', 'name' => 'Octobrush Nouveau']);
 }
Exemplo n.º 9
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getType()
 {
     return $this->hasOne(DeathReasonType::className(), ['id' => 'type_id']);
 }
Exemplo n.º 10
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'rapid_elite', 'name' => 'Rapid Blaster Pro', 'subweapon_id' => Subweapon::findOne(['key' => 'chasebomb'])->id, 'special_id' => Special::findOne(['key' => 'supershot'])->id]);
     $mainWeapon = DeathReasonType::findOne(['key' => 'main'])->id;
     $this->insert('death_reason', ['type_id' => $mainWeapon, 'key' => 'rapid_elite', 'name' => 'Rapid Blaster Pro']);
 }
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'slosher'])->id, 'key' => 'screwslosher_neo', 'name' => 'Sloshing Machine Neo', 'subweapon_id' => Subweapon::findOne(['key' => 'pointsensor'])->id, 'special_id' => Special::findOne(['key' => 'supershot'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'screwslosher_neo', 'name' => 'Sloshing Machine Neo']);
 }
Exemplo n.º 12
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'slosher'])->id, 'key' => 'screwslosher', 'name' => 'Sloshing Machine', 'subweapon_id' => Subweapon::findOne(['key' => 'splashbomb'])->id, 'special_id' => Special::findOne(['key' => 'bombrush'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'screwslosher', 'name' => 'Sloshing Machine']);
 }
Exemplo n.º 13
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'charger'])->id, 'key' => 'bamboo14mk2', 'name' => 'Bamboozler 14 Mk II', 'subweapon_id' => Subweapon::findOne(['key' => 'poison'])->id, 'special_id' => Special::findOne(['key' => 'supersensor'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'bamboo14mk2', 'name' => 'mboozler 14 Mk II']);
 }
Exemplo n.º 14
0
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'shooter'])->id, 'key' => 'bold_neo', 'name' => 'Neo Sploosh-o-matic', 'subweapon_id' => Subweapon::findOne(['key' => 'pointsensor'])->id, 'special_id' => Special::findOne(['key' => 'daioika'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'bold_neo', 'name' => 'Neo Sploosh-o-matic']);
 }
Exemplo n.º 15
0
 public function rules()
 {
     return [[['type'], 'exist', 'targetClass' => DeathReasonType::className(), 'targetAttribute' => 'key']];
 }
 public function safeUp()
 {
     $this->insert('weapon', ['type_id' => WeaponType::findOne(['key' => 'splatling'])->id, 'key' => 'splatspinner_collabo', 'name' => 'Zink Mini Splatling', 'subweapon_id' => Subweapon::findOne(['key' => 'poison'])->id, 'special_id' => Special::findOne(['key' => 'barrier'])->id]);
     $this->insert('death_reason', ['type_id' => DeathReasonType::findOne(['key' => 'main'])->id, 'key' => 'splatspinner_collabo', 'name' => 'Zink Mini Splatling']);
 }