public function delete(Application_Model_FilesystemShare $share)
 {
     if ($share->getId() !== null) {
         $where = $this->getDbTable()->getAdapter()->quoteInto("id = ?", $share->getId());
         $this->getDbTable()->delete($where);
     }
 }
Ejemplo n.º 2
0
 /**
  * Restore backupped shared directories
  * This is not a trigger of plugin API. It's called by Backupper plugin
  */
 function restoreItems($items)
 {
     $shares = Application_Model_FilesystemSharesMapper::i()->fetchAll();
     // cleaning up all shares
     foreach ($shares as $share) {
         Application_Model_FilesystemSharesMapper::i()->delete($share);
     }
     foreach (@$items['shares'] as $shareInfo) {
         $share = new Application_Model_FilesystemShare();
         $share->setPath(@$shareInfo['path'])->setImage(@$shareInfo['image'])->setLabel(@$shareInfo['label']);
         // i don't set id, or db adapter will try to update old data that i cleaned
         Application_Model_FilesystemSharesMapper::i()->save($share);
     }
     return X_Env::_('p_filesystem_backupper_restoreditems') . ": " . count($items['shares']);
     //return parent::restoreItems($items);
 }