public function getArticleAttachments() { return $this->hasMany(Attachments::className(), ['itemid' => 'id']); }
/** * Return Attachments * @return Attachments */ public function getAttachments() { return $this->hasMany(Attachments::className(), ['itemid' => 'id'])->from(Attachments::tableName() . ' AS attach'); }