fitness-web/common/models/CardKeyAssignment.php

63 lines
1.3 KiB
PHP

<?php
namespace common\models;
use Yii;
use yii\helpers\ArrayHelper;
use yii\behaviors\TimestampBehavior;
/**
* This is the model class for table "card_key_assignment".
*
* @property integer $id_card
* @property integer $id_key
* @property integer $id_user
* @property string $created_at
* @property string $updated_at
*/
class CardKeyAssignment extends \yii\db\ActiveRecord
{
public function behaviors()
{
return ArrayHelper::merge( [
[
'class' => TimestampBehavior::className(),
'value' => function(){ return date('Y-m-d H:i:s' ); }
],
], parent::behaviors());
}
/**
* @inheritdoc
*/
public static function tableName()
{
return 'card_key_assignment';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_card', 'id_key', 'id_user'], 'integer'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id_card' => Yii::t('common/image', 'Id Card'),
'id_key' => Yii::t('common/image', 'Id Key'),
'id_user' => Yii::t('common/image', 'Id User'),
'created_at' => Yii::t('common/image', 'Created At'),
'updated_at' => Yii::t('common/image', 'Updated At'),
];
}
}