Esempio n. 1
0
 public function deleteUserAttachments($userId)
 {
     $list = $this->attachmentDao->findByUserId($userId);
     /* @var $item BOL_Attachment */
     foreach ($list as $item) {
         if (file_exists($this->getAttachmentsDir() . $item->getFileName())) {
             unlink($this->getAttachmentsDir() . $item->getFileName());
         }
         $this->attachmentDao->delete($item);
     }
 }
Esempio n. 2
0
 public function deleteUserAttachments($userId)
 {
     $list = $this->attachmentDao->findByUserId($userId);
     /* @var $item BOL_Attachment */
     foreach ($list as $item) {
         $filePath = $this->getAttachmentsDir() . $item->getFileName();
         if (OW::getStorage()->fileExists($filePath)) {
             OW::getStorage()->removeFile($filePath);
         }
         $this->attachmentDao->delete($item);
     }
 }