예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAttr()
 {
     return $this->hasOne(Attributes::className(), ['id' => 'object_type_id']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAttrs()
 {
     return $this->hasMany(Attributes::className(), ['id' => 'attr_id'])->viaTable('attributes_attached', ['object_type_id' => 'id']);
 }