コード例 #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;
 }
コード例 #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;
 }
コード例 #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;
     }
 }
コード例 #4
0
 public function __construct($guid = null, ITreeNode $parent = null)
 {
     $this->guid = $guid ?: RandomUtils::guid();
     $this->parent = $parent;
 }
コード例 #5
0
ファイル: TempFile.php プロジェクト: edde-framework/edde
 public function __construct($name = null)
 {
     parent::__construct(sys_get_temp_dir() . '/' . ($name ?: RandomUtils::guid()));
 }