112 return array_key_exists($key, $this->properties);
124 return $this->properties[$key];
156 return $this->properties[
'identifier_hash'];
189 if ($this->deleted) {
190 throw new \RuntimeException(
'File has been deleted.', 1329821480);
192 if (empty($this->properties[
'size'])) {
195 $size = $this->properties[
'size'];
197 return $size ? (int)$size :
null;
218 if ($this->deleted) {
219 throw new \RuntimeException(
'File has been deleted.', 1329821481);
232 if ($this->deleted) {
233 throw new \RuntimeException(
'File has been deleted.', 1329821487);
246 if ($this->deleted) {
247 throw new \RuntimeException(
'File has been deleted.', 1329821488);
261 $extension = strtolower($pathinfo[
'extension'] ??
'');
273 return $this->properties[
'mime_type'] ?: array_pop($this->
getStorage()->getFileInfoByIdentifier($this->
getIdentifier(), [
'mimetype']));
294 if (!$this->properties[
'type']) {
296 list($fileType) = explode(
'/', $mimeType);
297 switch (strtolower($fileType)) {
319 return (
int)$this->properties[
'type'];
333 if ($this->deleted) {
334 throw new \RuntimeException(
'File has been deleted.', 1329821479);
349 if ($this->deleted) {
350 throw new \RuntimeException(
'File has been deleted.', 1329821478);
368 if ($this->storage ===
null) {
369 throw new \RuntimeException(
'You\'re using fileObjects without a storage.', 1381570091);
383 if ($this->deleted) {
426 $combinedIdentifier = $this->properties[
'storage'] .
':' . $this->
getIdentifier();
430 return $combinedIdentifier;
438 public function delete()
447 $this->properties = [];
458 $this->deleted =
true;
481 if ($this->deleted) {
482 throw new \RuntimeException(
'File has been deleted.', 1329821482);
499 if ($this->deleted) {
500 throw new \RuntimeException(
'File has been deleted.', 1329821483);
502 return $targetFolder->getStorage()->copyFile($this, $targetFolder, $targetFileName, $conflictMode);
517 if ($this->deleted) {
518 throw new \RuntimeException(
'File has been deleted.', 1329821484);
520 return $targetFolder->getStorage()->moveFile($this, $targetFolder, $targetFileName, $conflictMode);
535 public function getPublicUrl($relativeToCurrentScript =
false)
537 if ($this->deleted) {
555 if ($this->deleted) {
556 throw new \RuntimeException(
'File has been deleted.', 1329821486);