| @@ 68-83 (lines=16) @@ | ||
| 65 | * @return string |
|
| 66 | * @throws CException |
|
| 67 | */ |
|
| 68 | public function __get($name) |
|
| 69 | {
|
|
| 70 | if( in_array($name, $this->availableTypes) ) |
|
| 71 | {
|
|
| 72 | if( file_exists($this->getFullPath($name)) ) |
|
| 73 | {
|
|
| 74 | return '/' . $this->getFullPath($name); |
|
| 75 | } |
|
| 76 | else |
|
| 77 | {
|
|
| 78 | return $this->defaultImage; |
|
| 79 | } |
|
| 80 | } |
|
| 81 | else |
|
| 82 | return parent::__get($name); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * Создание пути для файла |
|
| @@ 80-95 (lines=16) @@ | ||
| 77 | * @return string |
|
| 78 | * @throws CException |
|
| 79 | */ |
|
| 80 | public function __get($name) |
|
| 81 | {
|
|
| 82 | if( in_array($name, $this->availableTypes) ) |
|
| 83 | {
|
|
| 84 | if( file_exists($this->getFullPath($name)) ) |
|
| 85 | {
|
|
| 86 | return '/' . $this->getFullPath($name); |
|
| 87 | } |
|
| 88 | ||
| 89 | return $this->defaultImage; |
|
| 90 | } |
|
| 91 | else |
|
| 92 | {
|
|
| 93 | throw new CException('Запрашиваемое изображение не существует');
|
|
| 94 | } |
|
| 95 | } |
|
| 96 | ||
| 97 | /** |
|
| 98 | * По умолчанию отдаётся оригинальный файл |
|