create project

This commit is contained in:
2024-04-24 18:02:58 +03:00
commit 17df2ce6a9
276 changed files with 15932 additions and 0 deletions

View File

@ -0,0 +1,72 @@
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "check_product".
*
* @property int $check_id
* @property int $product_id
* @property int|null $quantity
*
* @property Check $check
* @property Product $product
*/
class CheckProduct extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'check_product';
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['check_id', 'product_id'], 'required'],
[['check_id', 'product_id', 'quantity'], 'integer'],
[['check_id', 'product_id'], 'unique', 'targetAttribute' => ['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']);
}
}