public function MediaFile::__construct in MediaFront 7.2
File
- ./MediaFile.php, line 25
Class
- MediaFile
Code
public function __construct($file) {
if (!empty($file)) {
$file = gettype($file) == 'string' ? array(
'path' => $file,
) : $file;
$file = (object) $file;
$this->file = $file;
$this->path = $this
->getPath($file);
$this->extension = empty($file->extension) ? $this
->getExt() : $file->extension;
$this->mimetype = $this
->getMimeType($file);
$this->type = $this
->getType();
$this->class = $this
->getClass();
$this->mediaType = !empty($file->mediaType) ? $file->mediaType : $this->class;
}
}