12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- class FilePluginFile extends ElggFile {
- protected function initializeAttributes() {
- parent::initializeAttributes();
-
- $this->attributes['subtype'] = "file";
- }
- public function __construct($guid = null) {
- if ($guid && !is_object($guid)) {
-
-
-
- $guid = get_entity_as_row($guid);
- }
- parent::__construct($guid);
- }
- public function delete() {
- $thumbnails = array($this->thumbnail, $this->smallthumb, $this->largethumb);
- foreach ($thumbnails as $thumbnail) {
- if ($thumbnail) {
- $delfile = new ElggFile();
- $delfile->owner_guid = $this->owner_guid;
- $delfile->setFilename($thumbnail);
- $delfile->delete();
- }
- }
- return parent::delete();
- }
- }
|