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


PHP Core_Model_Item_Abstract::_postInsert方法代码示例

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


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

示例1: _postInsert

 protected function _postInsert()
 {
     // Increment user post count
     $table = Engine_Api::_()->getItemTable('forum_signature');
     $select = $table->select()->where('user_id = ?', $this->user_id)->limit(1);
     // Update user post count
     $row = $table->fetchRow($select);
     if (null === $row) {
         $row = $table->createRow();
         $row->user_id = $this->user_id;
         $row->post_count = 0;
     }
     $row->post_count = new Zend_Db_Expr('post_count + 1');
     $row->save();
     // Update topic post count
     $topic = $this->getParent();
     $topic->post_count = new Zend_Db_Expr('post_count + 1');
     $topic->modified_date = $this->creation_date;
     $topic->lastpost_id = $this->post_id;
     $topic->lastposter_id = $this->user_id;
     $topic->save();
     // Update forum post count
     $forum = $topic->getParent();
     $forum->post_count = new Zend_Db_Expr('post_count + 1');
     $forum->modified_date = $this->creation_date;
     $forum->lastpost_id = $this->post_id;
     $forum->lastposter_id = $this->user_id;
     $forum->save();
     parent::_postInsert();
 }
开发者ID:robeendey,项目名称:ce,代码行数:30,代码来源:Post.php

示例2: _postInsert

 public function _postInsert()
 {
     parent::_postInsert();
     // Create auth stuff
     $context = Engine_Api::_()->authorization()->context;
     $context->setAllowed($this, 'everyone', 'view', true);
     $context->setAllowed($this, 'registered', 'comment', true);
     $viewer = Engine_Api::_()->user()->getViewer();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:9,代码来源:Event.php

示例3: _postInsert

 protected function _postInsert()
 {
     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->lastpost_id = $this->post_id;
     $topic->lastposter_id = $this->user_id;
     $topic->modified_date = date('Y-m-d H:i:s');
     $topic->post_count++;
     $topic->save();
     parent::_postInsert();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:16,代码来源:Post.php

示例4: _postInsert

 protected function _postInsert()
 {
     if ($this->_disableHooks) {
         return;
     }
     parent::_postInsert();
     // Create auth stuff
     $context = Engine_Api::_()->authorization()->context;
     foreach (array('everyone', 'registered', 'member') as $role) {
         $context->setAllowed($this, $role, 'view', true);
     }
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:12,代码来源:Group.php

示例5: _postInsert

 protected function _postInsert()
 {
     parent::_postInsert();
     // Create auth stuff
     $context = $this->api()->authorization()->context;
     // View
     $view_options = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('user', $this, 'auth_view');
     if (empty($view_options) || !is_array($view_options)) {
         $view_options = array('member', 'network', 'registered', 'everyone');
     }
     foreach ($view_options as $role) {
         $context->setAllowed($this, $role, 'view', true);
     }
     // Comment
     $comment_options = (array) Engine_Api::_()->authorization()->getAdapter('levels')->getAllowed('user', $this, 'auth_comment');
     if (empty($comment_options) || !is_array($comment_options)) {
         $comment_options = array('member', 'network', 'registered', 'everyone');
     }
     foreach ($comment_options as $role) {
         $context->setAllowed($this, $role, 'comment', true);
     }
 }
开发者ID:robeendey,项目名称:ce,代码行数:22,代码来源:User.php

示例6: _postInsert

 protected function _postInsert()
 {
     // Update product
     $product = $this->getProduct();
     $product->setFromArray($this->getProductParams());
     $product->save();
     parent::_postInsert();
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:8,代码来源:Package.php

示例7: _postInsert

	protected function _postInsert()
	{
		$table = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');
		$select = $table -> select() -> where('user_id = ?', $this -> owner_id) -> limit(1);
		$row = $table -> fetchRow($select);

		if (null == $row)
		{
			$row = $table -> createRow();
			$row -> user_id = $this -> owner_id;
			$row -> video_count = 1;
		}
		else
		{
			$row -> video_count = new Zend_Db_Expr('video_count + 1');
		}
		$row -> save();
		parent::_postInsert();
	}
开发者ID:hoalangoc,项目名称:ftf,代码行数:19,代码来源:Video.php

示例8: _postInsert

 protected function _postInsert()
 {
     parent::_postInsert();
     // Update sku
     $this->_updateSku();
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:6,代码来源:Product.php


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