doorcardpass && door move manager logging
This commit is contained in:
@@ -159,7 +159,6 @@ class DateUtil
|
||||
}
|
||||
|
||||
public static function parseDate($dateString){
|
||||
|
||||
$date = DateTime::createFromFormat('Y.m.d', $dateString, new DateTimeZone( 'UTC'));
|
||||
$date->setTime(0, 0);
|
||||
return $date;
|
||||
@@ -187,4 +186,22 @@ class DateUtil
|
||||
return $translations[$weekDay];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $dateTime \DateTime
|
||||
* @return void
|
||||
*/
|
||||
public static function resetSeconds($dateTime){
|
||||
return $dateTime->setTime($dateTime->format("H"), $dateTime->format("i"),0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $dateTime \DateTime
|
||||
* @param $minutes integer
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function addMinutes($dateTime, $minutes){
|
||||
return $dateTime->add(new \DateInterval('PT' . $minutes . 'M'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
33
common/components/DoorMoveContext.php
Normal file
33
common/components/DoorMoveContext.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace common\components;
|
||||
|
||||
use yii\base\BaseObject;
|
||||
class DoorMoveContext extends BaseObject {
|
||||
|
||||
public $id;
|
||||
public $identifier;
|
||||
public $device;
|
||||
public $direction;
|
||||
public $originalDirection;
|
||||
|
||||
public $verifyOnly;
|
||||
public $created_at;
|
||||
public $date;
|
||||
|
||||
public $card;
|
||||
// todo: duplicate of card
|
||||
public $cardNumber;
|
||||
public $virtualKey;
|
||||
public $key;
|
||||
public $customer;
|
||||
public $ticket;
|
||||
|
||||
|
||||
public $kind;
|
||||
public $error;
|
||||
public $errorCode;
|
||||
public $exception;
|
||||
|
||||
public $actions = [];
|
||||
|
||||
}
|
||||
23
common/components/FitnessException.php
Normal file
23
common/components/FitnessException.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace common\components;
|
||||
|
||||
class FitnessException extends \Exception {
|
||||
const TYPE_BAD_REQUEST = "BAD_REQUEST";
|
||||
const UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
||||
public $errorCode;
|
||||
public $type;
|
||||
public $payload;
|
||||
public $originalException;
|
||||
|
||||
public function __construct( $message, $type = FitnessException::TYPE_BAD_REQUEST, $errorCode = null, $payload = null, $originalException= null) {
|
||||
parent::__construct();
|
||||
$this->message = $message;
|
||||
$this->type = $type;
|
||||
$this->errorCode = $errorCode;
|
||||
$this->payload = $payload;
|
||||
$this->originalException = $originalException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -548,4 +548,8 @@ class Helper {
|
||||
return Helper::getArrayValue(\Yii::$app->params ,'door_entry_strategy','strategy_key');
|
||||
}
|
||||
|
||||
public static function getDoorPassValidityIntervalMinutes(){
|
||||
return Helper::getArrayValue(\Yii::$app->params ,'door_pass_validity_interval_minutes','10');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user