Esempio n. 1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSources()
 {
     $_q = $this->hasMany(Source::className(), ['id' => 'source_id'])->via('sourceTopics');
     if (isset($this->limit)) {
         $_q->limit($this->limit);
     }
     return $_q;
 }
Esempio n. 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSource()
 {
     return $this->hasOne(Source::className(), ['id' => 'source_id']);
 }
Esempio n. 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSources()
 {
     return $this->hasMany(Source::className(), ['id' => 'source_id'])->viaTable('scoopit_source_keyword', ['keyword_id' => 'id']);
 }
Esempio n. 4
0
 public static function create($item)
 {
     $model = new Source();
     $model->setPostAttributes($item);
     $model->save();
     try {
         if ($model->save()) {
             return $model;
         }
     } catch (\Exception $ex) {
     }
     return null;
 }
Esempio n. 5
0
 public function actionDropAll()
 {
     Source::deleteAll('1=1');
 }