Exemplo n.º 1
0
 /**
  * data směrem do aplikace (tzn. např. databázová vrstva, etc...)
  *
  * @param mixed $value vstupní hodnota guid sanitizeru je ignorována
  *
  * @return string
  */
 public function input($value)
 {
     if ($this->guid === null) {
         $this->guid = RandomUtils::guid();
     }
     return $this->guid;
 }
Exemplo n.º 2
0
 /**
  * @param string null $guid
  *
  * @return string
  */
 public function guid($guid = null)
 {
     if ($guid !== null) {
         $this->guid = $guid;
     } else {
         if (!$this->guid) {
             $this->guid = RandomUtils::guid();
         }
     }
     return $this->guid;
 }
Exemplo n.º 3
0
 public function inTransaction(callable $callback)
 {
     $id = RandomUtils::guid();
     try {
         $this->startTransaction($id);
         $result = call_user_func($callback);
         $this->commitTransaction($id);
         return $result;
     } catch (\Exception $e) {
         $this->rollbackTransaction($id);
         throw $e;
     }
 }
Exemplo n.º 4
0
 public function __construct($guid = null, ITreeNode $parent = null)
 {
     $this->guid = $guid ?: RandomUtils::guid();
     $this->parent = $parent;
 }
Exemplo n.º 5
0
 public function __construct($name = null)
 {
     parent::__construct(sys_get_temp_dir() . '/' . ($name ?: RandomUtils::guid()));
 }