90 $this->dataConnector = $resourceLink->getDataConnector();
91 $this->resourceLinkId = $resourceLink->getRecordId();
105 $this->length = null;
107 $this->autoApprove =
false;
108 $this->expires = null;
132 if (empty($this->life)) {
133 $this->life = self::DEFAULT_SHARE_KEY_LIFE;
135 $this->life = max(min($this->life, self::MAX_SHARE_KEY_LIFE), 0);
137 $this->expires =
time() + ($this->life * 60 * 60);
138 if (empty($this->
id)) {
139 if (empty($this->length) || !is_numeric($this->length)) {
140 $this->length = self::MAX_SHARE_KEY_LENGTH;
142 $this->length = max(min($this->length, self::MAX_SHARE_KEY_LENGTH), self::MIN_SHARE_KEY_LENGTH);
147 return $this->dataConnector->saveResourceLinkShareKey($this);
156 public function delete()
159 return $this->dataConnector->deleteResourceLinkShareKey($this);
186 $this->dataConnector->loadResourceLinkShareKey($this);
187 if (!is_null($this->
id)) {
188 $this->length = strlen($this->
id);
190 if (!is_null($this->expires)) {
191 $this->life = ($this->expires -
time()) / 60 / 60;
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.