Example #1
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_AttachmentDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
 /**
  * @param string $pluginKey
  * @param string $bundle
  */
 public function deleteAttachmentByBundle($pluginKey, $bundle)
 {
     $attachments = $this->attachmentDao->findAttahcmentByBundle($pluginKey, $bundle);
     /* @var $attach BOL_Attachment */
     foreach ($attachments as $attach) {
         OW::getStorage()->removeFile($this->getAttachmentsDir() . $attach->getFileName());
         $this->attachmentDao->delete($attach);
     }
 }
Example #3
0
 public function saveAttachment(BOL_Attachment $dto)
 {
     $this->attachmentDao->save($dto);
 }