/** * @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; }
/** * @return \yii\db\ActiveQuery */ public function getSource() { return $this->hasOne(Source::className(), ['id' => 'source_id']); }
/** * @return \yii\db\ActiveQuery */ public function getSources() { return $this->hasMany(Source::className(), ['id' => 'source_id'])->viaTable('scoopit_source_keyword', ['keyword_id' => 'id']); }
public static function create($item) { $model = new Source(); $model->setPostAttributes($item); $model->save(); try { if ($model->save()) { return $model; } } catch (\Exception $ex) { } return null; }
public function actionDropAll() { Source::deleteAll('1=1'); }