<?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'),
        ];
    }
}
