['check_id', 'product_id']], [['check_id'], 'exist', 'skipOnError' => true, 'targetClass' => Check::class, 'targetAttribute' => ['check_id' => 'id']], [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::class, 'targetAttribute' => ['product_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'check_id' => 'Check ID', 'product_id' => 'Product ID', 'quantity' => 'Quantity', ]; } /** * Gets query for [[Check]]. * * @return \yii\db\ActiveQuery */ public function getCheck() { return $this->hasOne(Check::class, ['id' => 'check_id']); } /** * Gets query for [[Product]]. * * @return \yii\db\ActiveQuery */ public function getProduct() { return $this->hasOne(Product::class, ['id' => 'product_id']); } }