Elgg  Version 4.x
ElggTempFile.php
Go to the documentation of this file.
1 <?php
2 
4 
18 class ElggTempFile extends ElggFile {
19 
25  protected function initializeAttributes() {
26  parent::initializeAttributes();
27 
28  $this->attributes['subtype'] = 'temp_file';
29  $this->setFilename(uniqid());
30  }
31 
37  protected function getFilestore() {
38  return _elgg_services()->temp_filestore;
39  }
40 
44  public function transfer($owner_guid, $filename = null) {
45  return false;
46  }
47 
51  public function canDownload($user_guid = 0, $default = false) {
52  return false;
53  }
54 
58  public function getDownloadURL($use_cookie = true, $expires = '+2 hours') {
59  return '';
60  }
61 
65  public function getInlineURL($use_cookie = false, $expires = '') {
66  return '';
67  }
68 
74  public function save() : bool {
75  throw new IOException("Temp files can't be saved to the database");
76  }
77 
78 }
$default
Definition: checkbox.php:31
$user_guid
Definition: login_as.php:10
initializeAttributes()
Set subtype to &#39;temp_file&#39;.
This class represents a physical file (by default in the system temp directory).
An IO Exception, throw when an IO Exception occurs.
Definition: IOException.php:12
getInlineURL($use_cookie=false, $expires= '')
{}
transfer($owner_guid, $filename=null)
{}
setFilename($filename)
Set the filename of this file.
Definition: ElggFile.php:85
canDownload($user_guid=0, $default=false)
{}
$owner_guid
getFilestore()
Return the system temp filestore based on the system temp directory.
$filename
_elgg_services()
Get the global service provider.
Definition: elgglib.php:777
getDownloadURL($use_cookie=true, $expires= '+2 hours')
{}