Beispiel #1
0
 protected function updateSecSers()
 {
     SecSer::deleteAll(['ser' => $this->id]);
     if (is_array($this->sectionsId)) {
         foreach ($this->sectionsId as $id) {
             $secSer = new SecSer();
             $secSer->ser = $this->id;
             $secSer->sec = $id;
             $secSer->save();
         }
     }
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSecSers()
 {
     return $this->hasMany(SecSer::className(), ['sec' => 'id']);
 }