fitness-web/common/models/DoorManagerLog.php
2023-02-20 18:45:00 +01:00

68 lines
1.6 KiB
PHP

<?php
namespace common\models;
use Yii;
use common\components\Helper;
use yii\behaviors\TimestampBehavior;
use yii\helpers\ArrayHelper;
/**
* This is the model class for table "door_manager_log".
*
* @property string $request_id
* @property string $identifier
* @property string $device
* @property string $direction
* @property string $original_direction
* @property bool $verify_only
* @property datetime $created_at
* @property integer $card_id_card
* @property string $card_number
* @property integer $virtual_key_id
* @property integer $key_id_key
* @property string $key_number
* @property string $customer_id_customer
* @property string $customer_name
* @property string $customer_email
* @property string $ticket_id_ticket
* @property string $ticket_usage_count
* @property string $ticket_usage
* @property string $ticket_type_name
* @property string $validation_kind
* @property bool $error
* @property string $error_code
* @property string $error_message
*
*/
class DoorManagerLog extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'door_manager_log';
}
public function behaviors()
{
return ArrayHelper::merge([
[
'class' => TimestampBehavior::className(),
'value' => function ($event) {
if ( isset($event->sender->created_at) ){
return $event->sender->created_at;
}
return date('Y-m-d H:i:s');
},
'updatedAtAttribute' => false,
]
], parent::behaviors());
}
}