Elgg  Version 3.0
ElggTempFile.php
Go to the documentation of this file.
1 <?php
2 
16 class ElggTempFile extends ElggFile {
17 
23  protected function initializeAttributes() {
24  parent::initializeAttributes();
25 
26  $this->attributes['subtype'] = 'temp_file';
27  $this->setFilename(uniqid());
28  }
29 
35  protected function getFilestore() {
36  return _elgg_services()->temp_filestore;
37  }
38 
42  public function transfer($owner_guid, $filename = null) {
43  return false;
44  }
45 
49  public function canDownload($user_guid = 0, $default = false) {
50  return false;
51  }
52 
56  public function getDownloadURL($use_cookie = true, $expires = '+2 hours') {
57  return '';
58  }
59 
63  public function getInlineURL($use_cookie = false, $expires = '') {
64  return '';
65  }
66 
70  public function save() {
71  throw new \IOException("Temp files can't be saved to the database");
72  }
73 
74 }
initializeAttributes()
Set subtype to &#39;temp_file&#39;.
This class represents a physical file (by default in the system temp directory).
getInlineURL($use_cookie=false, $expires= '')
{}
transfer($owner_guid, $filename=null)
{}
canDownload($user_guid=0, $default=false)
{}
$user_guid
Validate a user.
Definition: validate.php:6
$owner_guid
getFilestore()
Return the system temp filestore based on the system temp directory.
$default
Definition: checkbox.php:35
$filename
setFilename($name)
Set the filename of this file.
Definition: ElggFile.php:58
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
getDownloadURL($use_cookie=true, $expires= '+2 hours')
{}