diff options
Diffstat (limited to 'mod/lightbox/classes/LightboxPluginAlbum.php')
-rw-r--r-- | mod/lightbox/classes/LightboxPluginAlbum.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mod/lightbox/classes/LightboxPluginAlbum.php b/mod/lightbox/classes/LightboxPluginAlbum.php new file mode 100644 index 000000000..de272d981 --- /dev/null +++ b/mod/lightbox/classes/LightboxPluginAlbum.php @@ -0,0 +1,31 @@ +<?php + +/** + * Override the ElggObject + */ +class LightboxPluginAlbum extends ElggObject { + protected function initializeAttributes() { + parent::initializeAttributes(); + + $this->attributes['subtype'] = "album"; + } + + public function __construct($guid = null) { + parent::__construct($guid); + } + + public function attachImages($images) { + foreach($images as $image) { + if($image instanceof LightboxPluginImage) { + $this->addRelationship($image->guid, 'in_album'); + } else { + return false; + } + } + return true; + } + + public function delete() { + return parent::delete(); + } +} |