protected function _postDelete() { parent::_postDelete(); $playlist = Engine_Api::_()->getItem('ynvideo_playlist', $this->playlist_id); if ($playlist) { $playlist->video_count = new Zend_Db_Expr('video_count - 1'); $playlist->save(); } }
protected function _postDelete() { parent::_postDelete(); $model = new Yntour_Model_DbTable_Touritems(); $select = $model->select()->where('tour_id=?', $this->getIdentity()); foreach ($model->fetchAll($select) as $row) { $row->delete(); } }
protected function _postDelete() { parent::_postDelete(); if (file_exists($this->photo_url)) { @unlink($this->photo_url); } }
protected function _postDelete() { $photoTable = Engine_Api::_()->getItemTable('album_photo'); $photoSelect = $photoTable->select()->where('album_id = ?', $this->getIdentity()); foreach ($photoTable->fetchAll($photoSelect) as $photo) { $photo->skipAlbumDeleteHook = true; try { $photo->delete(); } catch (Exception $e) { // Silence } } parent::_postDelete(); }
protected function _postDelete() { parent::_postDelete(); // Remove all association videos to this playlist $table = Engine_Api::_()->getDbtable('playlistassoc', 'ynvideo'); $select = $table->select()->where('playlist_id = ?', $this->getIdentity()); foreach ($table->fetchAll($select) as $playlistAssoc) { $playlistAssoc->delete(); } }
protected function _postDelete() { $mainPhoto = Engine_Api::_()->getItemTable('storage_file')->getFile($this->file_id); $thumbPhoto = Engine_Api::_()->getItemTable('storage_file')->getFile($this->file_id, 'thumb.normal'); // Delete thumb if ($thumbPhoto && $thumbPhoto->getIdentity()) { try { $thumbPhoto->delete(); } catch (Exception $e) { } } // Delete main if ($mainPhoto && $mainPhoto->getIdentity()) { try { $mainPhoto->delete(); } catch (Exception $e) { } } // Change album cover if applicable try { if (!empty($this->album_id) && !$this->skipAlbumDeleteHook) { $album = $this->getAlbum(); $nextPhoto = $this->getNextPhoto(); if ($album instanceof Album_Model_Album && $nextPhoto instanceof Album_Model_Photo && (int) $album->photo_id == (int) $this->getIdentity()) { $album->photo_id = $nextPhoto->getIdentity(); $album->save(); } } } catch (Exception $e) { } parent::_postDelete(); }
protected function _postDelete() { parent::_postDelete(); // $signatureItem = Engine_Api::_()->getItem('ynvideo_signature', $this->owner_id); // if ($signatureItem) { // if ($signatureItem->video_count > 0) { // $signatureItem->video_count = new Zend_Db_Expr('video_count - 1'); // $signatureItem->save(); // } // } }