12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- /**
- * Created by PhpStorm.
- * User: tioncico
- * Date: 19-10-4
- * Time: 下午3:37
- */
- namespace EasySwoole\Redis;
- class RedisTransaction
- {
- protected $commandLog = [];
- protected $isTransaction = false;
- const IGNORE_COMMAND = [
- 'discard',
- 'exec',
- 'multi',
- // 'unWatch',
- // 'watch',
- ];
- /**
- * @return array
- */
- public function getCommandLog(): array
- {
- return $this->commandLog;
- }
- /**
- * @param array $commandLog
- */
- public function setCommandLog(array $commandLog): void
- {
- $this->commandLog = $commandLog;
- }
- function addCommand($command)
- {
- $this->commandLog[] = $command;
- }
- /**
- * @return bool
- */
- public function isTransaction(): bool
- {
- return $this->isTransaction;
- }
- /**
- * @param bool $isTransaction
- */
- public function setIsTransaction(bool $isTransaction): void
- {
- $this->isTransaction = $isTransaction;
- }
- }
|