61 lines
1.1 KiB
PHP
61 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use Yii;
|
|
use yii\behaviors\TimestampBehavior;
|
|
|
|
/**
|
|
* This is the model class for table "image".
|
|
*
|
|
* @property integer $id_image
|
|
* @property string $path
|
|
* @property string $created_at
|
|
* @property string $updated_at
|
|
*/
|
|
class Image extends \yii\db\ActiveRecord
|
|
{
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return 'image';
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['path'], 'string', 'max' => 255]
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[ 'class' => TimestampBehavior::className(),
|
|
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
|
]
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @inheritdoc
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'id_image' => Yii::t('common/image', 'Id Image'),
|
|
'path' => Yii::t('common/image', 'Path'),
|
|
'created_at' => Yii::t('common/image', 'Created At'),
|
|
'updated_at' => Yii::t('common/image', 'Updated At'),
|
|
];
|
|
}
|
|
}
|