Commit ea0f089f authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

UploadedFile: ajout de méthodes "getContent" et "getLastModified".

Showing with 18 additions and 1 deletion
+18 -1
...@@ -252,7 +252,7 @@ class UploadedFile ...@@ -252,7 +252,7 @@ class UploadedFile
/** /**
* Get createdAt * Get createdAt
* *
* @return \datettime * @return \DateTime
*/ */
public function getCreatedAt() public function getCreatedAt()
{ {
...@@ -359,4 +359,21 @@ class UploadedFile ...@@ -359,4 +359,21 @@ class UploadedFile
$stream->open(new StreamMode($mode)); $stream->open(new StreamMode($mode));
return $stream; return $stream;
} }
/**
*
* @return string
*/
public function getContent()
{
return $this->filesystem->read($this->getPath());
}
/**
* @return \DateTime
*/
public function getLastModified()
{
return new \DateTime(sprintf('@%d', $this->filesystem->mtime($this->getPath())));
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment