add door manager logs
This commit is contained in:
67
common/models/DoorManagerLog.php
Normal file
67
common/models/DoorManagerLog.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user