You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.1 KiB
69 lines
1.1 KiB
2 months ago
|
<?php
|
||
|
|
||
|
namespace AlibabaCloud\Client\Traits;
|
||
|
|
||
|
/**
|
||
|
* Trait HistoryTrait
|
||
|
*
|
||
|
* @package AlibabaCloud\Client\Traits
|
||
|
*/
|
||
|
trait HistoryTrait
|
||
|
{
|
||
|
/**
|
||
|
* @var array
|
||
|
*/
|
||
|
private static $history = [];
|
||
|
|
||
|
/**
|
||
|
* @var bool
|
||
|
*/
|
||
|
private static $isRememberHistory = false;
|
||
|
|
||
|
/**
|
||
|
* @return array
|
||
|
*/
|
||
|
public static function getHistory()
|
||
|
{
|
||
|
return self::$history;
|
||
|
}
|
||
|
|
||
|
public static function forgetHistory()
|
||
|
{
|
||
|
self::$history = [];
|
||
|
}
|
||
|
|
||
|
public static function notRememberHistory()
|
||
|
{
|
||
|
self::$isRememberHistory = false;
|
||
|
}
|
||
|
|
||
|
public static function rememberHistory()
|
||
|
{
|
||
|
self::$isRememberHistory = true;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return bool
|
||
|
*/
|
||
|
public static function isRememberHistory()
|
||
|
{
|
||
|
return self::$isRememberHistory;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return array
|
||
|
*/
|
||
|
public static function &referenceHistory()
|
||
|
{
|
||
|
return self::$history;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return int
|
||
|
*/
|
||
|
public static function countHistory()
|
||
|
{
|
||
|
return count(self::$history);
|
||
|
}
|
||
|
}
|