/** * 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; }
/** * @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; }
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; } }
public function __construct($guid = null, ITreeNode $parent = null) { $this->guid = $guid ?: RandomUtils::guid(); $this->parent = $parent; }
public function __construct($name = null) { parent::__construct(sys_get_temp_dir() . '/' . ($name ?: RandomUtils::guid())); }