Files
image/Image.class.php

36 lines
798 B
PHP
Raw Normal View History

2013-05-24 13:27:47 +04:00
<?php
class Image extends File
2013-05-24 13:27:47 +04:00
{
public $width;
public $height;
public $type;
public $size;
2013-05-24 13:27:47 +04:00
public $original_filename;
public $variants = array();
protected $sizes;
2013-05-24 13:27:47 +04:00
/**
* @param $class string
* @throws ErrorException
2013-05-24 13:27:47 +04:00
*/
public static function checkSubClass($class)
2013-05-24 13:27:47 +04:00
{
if (is_null($class) || $class == '') {
throw new ErrorException('Class not defined.');
}
if (!class_exists($class)) {
throw new ErrorException('Class "' . $class . '" not exists.');
}
if (get_parent_class($class) != 'Image') {
throw new ErrorException('Class "' . $class . '" mast be extend of "Image".');
2013-05-24 13:27:47 +04:00
}
}
public function getSizes()
{
return $this->sizes;
2013-05-24 13:27:47 +04:00
}
}