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

UploadedFile: ajout d'une méthode toArray().

Showing with 21 additions and 0 deletions
+21 -0
...@@ -539,4 +539,19 @@ class UploadedFile implements UploadedFileInterface ...@@ -539,4 +539,19 @@ class UploadedFile implements UploadedFileInterface
} }
return true; return true;
} }
/**
* @return array
*/
public function toArray()
{
return [
'id' => $this->getId(),
'name' => $this->getDisplayName(),
'size' => $this->getSize(),
'type' => $this->getMimeType(),
'etat' => $this->getEtat(),
'checksum' => $this->getChecksum(),
];
}
} }
...@@ -205,4 +205,10 @@ interface UploadedFileInterface ...@@ -205,4 +205,10 @@ interface UploadedFileInterface
* @return int * @return int
*/ */
public function copyTo($dest, $maxlen = PHP_INT_MAX, $readOffset = 0); public function copyTo($dest, $maxlen = PHP_INT_MAX, $readOffset = 0);
/**
* @return array
*/
public function toArray();
} }
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