Add waste

This commit is contained in:
2016-05-08 08:56:42 +02:00
parent a6fdfb1c83
commit f8e1f90a8e
28 changed files with 1075 additions and 102 deletions

76
common/models/Waste.php Normal file
View File

@@ -0,0 +1,76 @@
<?php
namespace common\models;
use Yii;
use yii\helpers\ArrayHelper;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "waste".
*
* @property integer $id_waste
* @property integer $count
* @property integer $id_product
* @property integer $stock_before
* @property integer $stock_after
* @property integer $id_user
* @property string $comment
* @property string $created_at
* @property string $updated_at
*/
class Waste extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'waste';
}
public function behaviors()
{
return ArrayHelper::merge( [
[
'class' => TimestampBehavior::className(),
'value' => function(){ return date('Y-m-d H:i:s' ); }
],
], parent::behaviors());
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['count', 'id_product', ], 'integer'],
[['comment'], 'string', 'max' => 255],
[['productIdentifier'], 'string', 'max' => 128],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id_waste' => Yii::t('common/waste', 'Id Waste'),
'count' => Yii::t('common/waste', 'Mennyiség'),
'id_product' => Yii::t('common/waste', 'Termék'),
'stock_before' => Yii::t('common/waste', 'Mennyiség előtte'),
'stock_after' => Yii::t('common/waste', 'Mennyiség utána'),
'id_user' => Yii::t('common/waste', 'Felhasználó'),
'comment' => Yii::t('common/waste', 'Megjegyzés'),
'created_at' => Yii::t('common/waste', 'Létrehozva'),
'updated_at' => Yii::t('common/waste', 'Updated At'),
];
}
}