当前位置: 首页>>代码示例>>PHP>>正文


PHP Core_Model_Item_Abstract::_delete方法代码示例

本文整理汇总了PHP中Core_Model_Item_Abstract::_delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Core_Model_Item_Abstract::_delete方法的具体用法?PHP Core_Model_Item_Abstract::_delete怎么用?PHP Core_Model_Item_Abstract::_delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core_Model_Item_Abstract的用法示例。


在下文中一共展示了Core_Model_Item_Abstract::_delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _delete

 protected function _delete()
 {
     foreach ($this->getAll() as $listitem) {
         $listitem->delete();
     }
     parent::_delete();
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:7,代码来源:MailTemplate.php

示例2: _delete

 protected function _delete()
 {
     if ($this->_disableHooks) {
         return;
     }
     // Delete all memberships
     $this->membership()->removeAllMembers();
     // Delete all albums
     $albumTable = Engine_Api::_()->getItemTable('event_album');
     $albumSelect = $albumTable->select()->where('event_id = ?', $this->getIdentity());
     foreach ($albumTable->fetchAll($albumSelect) as $eventAlbum) {
         $eventAlbum->delete();
     }
     // Delete all topics
     $topicTable = Engine_Api::_()->getItemTable('event_topic');
     $topicSelect = $topicTable->select()->where('event_id = ?', $this->getIdentity());
     foreach ($topicTable->fetchAll($topicSelect) as $eventTopic) {
         $eventTopic->delete();
     }
     parent::_delete();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:21,代码来源:Event.php

示例3: _delete

 protected function _delete()
 {
     foreach ($this->getCollectibles() as $collectible) {
         $collectible->delete();
     }
     return parent::_delete();
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:7,代码来源:Collection.php

示例4: _delete

 protected function _delete()
 {
     // Delete stream stuff
     Engine_Api::_()->getDbtable('stream', 'activity')->delete(array('action_id = ?' => $this->action_id));
     // Delete attachments
     Engine_Api::_()->getDbtable('attachments', 'activity')->delete(array('action_id = ?' => $this->action_id));
     parent::_delete();
 }
开发者ID:robeendey,项目名称:ce,代码行数:8,代码来源:Action.php

示例5: _delete

 protected function _delete()
 {
     if ($this->_disableHooks) {
         return;
     }
     //Delete Blog Member
     $become_table = Engine_Api::_()->getDbTable('becomes', 'ynblog');
     $become_selected = $become_table->select()->where('blog_id = ?', $this->getIdentity());
     foreach ($become_table->fetchAll($become_selected) as $blog_become) {
         $blog_become->delete();
     }
     parent::_delete();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:13,代码来源:Blog.php

示例6: _delete

 protected function _delete()
 {
     if ($this->_disableHooks) {
         return;
     }
     // Delete all memberships
     $this->membership()->removeAllMembers();
     // Delete officer list
     $this->getOfficerList()->delete();
     // Delete all albums
     $albumTable = Engine_Api::_()->getItemTable('advgroup_album');
     $albumSelect = $albumTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($albumTable->fetchAll($albumSelect) as $groupAlbum) {
         $groupAlbum->delete();
     }
     // Delete all topics
     $topicTable = Engine_Api::_()->getItemTable('advgroup_topic');
     $topicSelect = $topicTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($topicTable->fetchAll($topicSelect) as $groupTopic) {
         $groupTopic->delete();
     }
     //Delete all links
     $linkTable = Engine_Api::_()->getItemTable('advgroup_link');
     $linkSelect = $linkTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($linkTable->fetchAll($linkSelect) as $groupLink) {
         $groupLink->delete();
     }
     //Delete all announcment
     $announcementTable = Engine_Api::_()->getItemTable('advgroup_announcement');
     $announcementSelect = $announcementTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($announcementTable->fetchAll($announcementSelect) as $groupAnnouncement) {
         $groupAnnouncement->delete();
     }
     //Delete invites
     $inviteTable = Engine_Api::_()->getDbTable('invites', 'advgroup');
     $inviteSelect = $inviteTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($inviteTable->fetchAll($inviteSelect) as $groupInvite) {
         $groupInvite->delete();
     }
     //Delete polls
     $pollTable = Engine_Api::_()->getDbTable('polls', 'advgroup');
     $pollSelect = $pollTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($pollTable->fetchAll($pollSelect) as $groupPoll) {
         $groupPoll->delete();
     }
     //Delete reports
     $reportTable = Engine_Api::_()->getDbTable('reports', 'advgroup');
     $reportSelect = $reportTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($reportTable->fetchAll($reportSelect) as $groupReport) {
         $groupReport->delete();
     }
     //Delete all events
     if (Engine_Api::_()->hasItemType('event')) {
         $eventTable = Engine_Api::_()->getItemTable('event');
         $eventSelect = $eventTable->select()->where("parent_type = 'group' and parent_id = ?", $this->getIdentity());
         foreach ($eventTable->fetchAll($eventSelect) as $groupEvent) {
             $groupEvent->delete();
         }
     }
     if (Engine_Api::_()->hasItemType('video')) {
         $videoTable = Engine_Api::_()->getItemTable('video');
         $videoSelect = $videoTable->select()->where("parent_type = 'group' and parent_id = ?", $this->getIdentity());
         foreach ($videoTable->fetchAll($videoSelect) as $groupVideo) {
             $groupVideo->delete();
         }
     }
     parent::_delete();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:68,代码来源:Group.php

示例7: _delete

 protected function _delete()
 {
     // Check level
     $level = Engine_Api::_()->getItem('authorization_level', $this->level_id);
     if ($level->flag == 'superadmin') {
         throw new User_Model_Exception('Cannot delete superadmins.');
     }
     // Remove from online users
     $table = $this->api()->getDbtable('online', 'user');
     $table->delete(array('user_id = ?' => $this->getIdentity()));
     // Remove fields values
     Engine_Api::_()->fields()->removeItemValues($this);
     // Call parent
     parent::_delete();
 }
开发者ID:robeendey,项目名称:ce,代码行数:15,代码来源:User.php

示例8: _delete

 protected function _delete() {
     parent::_delete();
     
     $categories = $this->fetchSubCategories();
     foreach($categories as $category) {
         $category->delete();
     }
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:8,代码来源:Category.php

示例9: _delete

 protected function _delete()
 {
     Engine_Api::_()->getApi('search', 'core')->unindex($this);
     if ($this->_disableHooks) {
         return;
     }
     // Update topic
     $table = Engine_Api::_()->getDbtable('topics', 'advgroup');
     $select = $table->select()->where('topic_id = ?', $this->topic_id)->limit(1);
     $topic = $table->fetchRow($select);
     $topic->post_count--;
     if ($topic->post_count == 0) {
         $topic->delete();
     } else {
         $topic->save();
     }
     parent::_delete();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:18,代码来源:Post.php

示例10: _delete

 protected function _delete()
 {
     if ($this->_disableHooks) {
         return;
     }
     // Delete all child posts
     $postTable = Engine_Api::_()->getItemTable('group_post');
     $postSelect = $postTable->select()->where('topic_id = ?', $this->getIdentity());
     foreach ($postTable->fetchAll($postSelect) as $groupPost) {
         $groupPost->disableHooks()->delete();
     }
     parent::_delete();
 }
开发者ID:robeendey,项目名称:ce,代码行数:13,代码来源:Topic.php

示例11: _delete

 protected function _delete()
 {
     if ($this->_disableHooks) {
         return;
     }
     // Delete all memberships
     $this->membership()->removeAllMembers();
     // Delete officer list
     $this->getOfficerList()->delete();
     // Delete all albums
     $albumTable = Engine_Api::_()->getItemTable('group_album');
     $albumSelect = $albumTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($albumTable->fetchAll($albumSelect) as $groupAlbum) {
         $groupAlbum->delete();
     }
     // Delete all topics
     $topicTable = Engine_Api::_()->getItemTable('group_topic');
     $topicSelect = $topicTable->select()->where('group_id = ?', $this->getIdentity());
     foreach ($topicTable->fetchAll($topicSelect) as $groupTopic) {
         $groupTopic->delete();
     }
     if (Engine_Api::_()->hasItemType('event')) {
         $eventTable = Engine_Api::_()->getItemTable('event');
         $eventSelect = $eventTable->select()->where("parent_type = 'group' and parent_id = ?", $this->getIdentity());
         foreach ($eventTable->fetchAll($eventSelect) as $groupEvent) {
             $groupEvent->delete();
         }
     }
     parent::_delete();
 }
开发者ID:robeendey,项目名称:ce,代码行数:30,代码来源:Group.php

示例12: _delete

 protected function _delete()
 {
     // delete poll votes
     Engine_Api::_()->getDbtable('pollVotes', 'advgroup')->delete(array('poll_id = ?' => $this->getIdentity()));
     // delete poll options
     Engine_Api::_()->getDbtable('pollOptions', 'advgroup')->delete(array('poll_id = ?' => $this->getIdentity()));
     parent::_delete();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:8,代码来源:Poll.php

示例13: _delete

 protected function _delete()
 {
     $forum = $this->getParent();
     // Decrement forum topic and post count
     $forum->topic_count = new Zend_Db_Expr('topic_count - 1');
     $forum->post_count = new Zend_Db_Expr(sprintf('post_count - %s', $this->post_count));
     // Update forum last post
     $olderForumLastPost = Engine_Api::_()->getDbtable('posts', 'forum')->select()->where('forum_id = ?', $this->forum_id)->where('topic_id != ?', $this->topic_id)->order('post_id DESC')->limit(1)->query()->fetch();
     if ($olderForumLastPost['post_id'] != $forum->lastpost_id) {
         if ($olderForumLastPost) {
             $forum->lastpost_id = $olderForumLastPost['post_id'];
             $forum->lastposter_id = $olderForumLastPost['user_id'];
         } else {
             $forum->lastpost_id = null;
             $forum->lastposter_id = null;
         }
     }
     $forum->save();
     // Delete all posts
     $table = Engine_Api::_()->getItemTable('forum_post');
     $select = $table->select()->where('topic_id = ?', $this->getIdentity());
     foreach ($table->fetchAll($select) as $post) {
         $post->deletingTopic = true;
         $post->delete();
     }
     // remove topic views
     Engine_Api::_()->getDbTable('topicviews', 'forum')->delete(array('topic_id = ?' => $this->topic_id));
     // remove topic watches
     Engine_Api::_()->getDbTable('topicWatches', 'forum')->delete(array('resource_id = ?' => $this->forum_id, 'topic_id = ?' => $this->topic_id));
     parent::_delete();
 }
开发者ID:robeendey,项目名称:ce,代码行数:31,代码来源:Topic.php

示例14: _delete

 protected function _delete()
 {
     // @todo problems may occur if this is getting deleted with parent
     $collection = $this->getCollection();
     if ($collection && isset($collection->collectible_count)) {
         $collection->collectible_count--;
         $collection->save();
     }
     parent::_delete();
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:10,代码来源:Collectible.php

示例15: _delete

	protected function _delete()
	{
		// remove video from favorite table
		Engine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));

		// remove video from favorite table
		Engine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));

		// remove video from rating table
		Engine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));

		// remove video from watchlater table
		Engine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));

		// update video count in signature table
		$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');
		$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));
		if ($signature)
		{
			$signature -> video_count = new Zend_Db_Expr('video_count - 1');
		}
		$signature -> save();

		// remove video from playlists
		$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');
		$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));
		foreach ($playlistAssocs as $playlistAssoc)
		{
			$playlistAssoc -> delete();
		}

		parent::_delete();
	}
开发者ID:hoalangoc,项目名称:ftf,代码行数:33,代码来源:Video.php


注:本文中的Core_Model_Item_Abstract::_delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。