mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
new api 2.0
This commit is contained in:
parent
366b68a571
commit
a8fc9c767d
@ -819,6 +819,7 @@ define('AUDIT_LOG_INCIDENT_MANAGEMENT', 'Incident management');
|
|||||||
define('AUDIT_LOG_UMC', 'Warp Manager');
|
define('AUDIT_LOG_UMC', 'Warp Manager');
|
||||||
define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation');
|
define('AUDIT_LOG_NMS_VIOLATION', 'NMS Violation');
|
||||||
define('AUDIT_LOG_ENTERPRISE_VIOLATION', 'Enterprise Violation');
|
define('AUDIT_LOG_ENTERPRISE_VIOLATION', 'Enterprise Violation');
|
||||||
|
define('AUDIT_LOG_EVENT', 'Events');
|
||||||
|
|
||||||
// MIMEs.
|
// MIMEs.
|
||||||
define(
|
define(
|
||||||
|
@ -13,6 +13,8 @@ class Validator
|
|||||||
public const GREATERTHAN = 'GreaterThan';
|
public const GREATERTHAN = 'GreaterThan';
|
||||||
public const GREATEREQUALTHAN = 'GreaterEqualThan';
|
public const GREATEREQUALTHAN = 'GreaterEqualThan';
|
||||||
public const DATETIME = 'DateTime';
|
public const DATETIME = 'DateTime';
|
||||||
|
public const DATE = 'Date';
|
||||||
|
public const TIME = 'Time';
|
||||||
public const TIMEZONE = 'TimeZone';
|
public const TIMEZONE = 'TimeZone';
|
||||||
public const LANGUAGE = 'Language';
|
public const LANGUAGE = 'Language';
|
||||||
public const MAIL = 'Mail';
|
public const MAIL = 'Mail';
|
||||||
@ -94,6 +96,18 @@ class Validator
|
|||||||
return $d && $d->format($format) == $date;
|
return $d && $d->format($format) == $date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isDate($date, $format = 'Y-m-d')
|
||||||
|
{
|
||||||
|
$d = \DateTime::createFromFormat($format, $date);
|
||||||
|
return $d && $d->format($format) == $date;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isTime($date, $format = 'H:i:s')
|
||||||
|
{
|
||||||
|
$d = \DateTime::createFromFormat($format, $date);
|
||||||
|
return $d && $d->format($format) == $date;
|
||||||
|
}
|
||||||
|
|
||||||
public function isTimeZone(string $timeZone): string
|
public function isTimeZone(string $timeZone): string
|
||||||
{
|
{
|
||||||
return array_search($timeZone, timezone_identifiers_list());
|
return array_search($timeZone, timezone_identifiers_list());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user