示例#1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPeca()
 {
     return $this->hasOne(Pecas::className(), ['id' => 'peca_id']);
 }
示例#2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPecas()
 {
     return $this->hasMany(Pecas::className(), ['categoria_id' => 'id']);
 }