forked from symfony-cmf/media-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileInterface.php
68 lines (59 loc) · 1.46 KB
/
FileInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2014 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Cmf\Bundle\MediaBundle;
/**
* Interface for objects containing a file.
*
* This is to be kept compatible with the SonataMediaBundle MediaInterface to
* allow integration with sonata.
*/
interface FileInterface extends HierarchyInterface, MetadataInterface
{
/**
* Returns the content
*
* @return string
*/
public function getContentAsString();
/**
* Set the content
*
* @param string $content
*/
public function setContentFromString($content);
/**
* Copy the content from a file, this allows to optimize copying the data
* of a file. It is preferred to use the dedicated content setters if
* possible.
*
* @param FileInterface|\SplFileInfo $file
*
* @throws \InvalidArgumentException if file is no FileInterface|\SplFileInfo
*/
public function copyContentFromFile($file);
/**
* The mime type of this media element
*
* @return string
*/
public function getContentType();
/**
* Returns the extension of the file
*
* @return string
*/
public function getExtension();
/**
* Get the file size in bytes
*
* @return integer
*/
public function getSize();
}