當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Core_Model_Item_Abstract::_insert方法代碼示例

本文整理匯總了PHP中Core_Model_Item_Abstract::_insert方法的典型用法代碼示例。如果您正苦於以下問題:PHP Core_Model_Item_Abstract::_insert方法的具體用法?PHP Core_Model_Item_Abstract::_insert怎麽用?PHP Core_Model_Item_Abstract::_insert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Core_Model_Item_Abstract的用法示例。


在下文中一共展示了Core_Model_Item_Abstract::_insert方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _insert

 protected function _insert()
 {
     if (!$this->event_id) {
         throw new Exception('Cannot create post without event_id');
     }
     if (!$this->topic_id) {
         throw new Exception('Cannot create post without topic_id');
     }
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:10,代碼來源:Post.php

示例2: _insert

 protected function _insert()
 {
     if (empty($this->topic_id)) {
         throw new Forum_Model_Exception('Cannot have a post without a topic');
     }
     if (empty($this->user_id)) {
         throw new Forum_Model_Exception('Cannot have a post without a user');
     }
     parent::_insert();
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:10,代碼來源:Post.php

示例3: _insert

 protected function _insert()
 {
     if (!$this->event_id) {
         throw new Exception('Cannot create topic without event_id');
     }
     /*
     $this->getParentEvent()->setFromArray(array(
     
     ))->save();
     */
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:12,代碼來源:Topic.php

示例4: _insert

 protected function _insert()
 {
     if ($this->_disableHooks) {
         return;
     }
     if (!$this->group_id) {
         throw new Exception('Cannot create post without group_id');
     }
     if (!$this->topic_id) {
         throw new Exception('Cannot create post without topic_id');
     }
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:13,代碼來源:Post.php

示例5: _insert

 protected function _insert()
 {
     if ($this->_disableHooks) {
         return;
     }
     if (!$this->group_id) {
         throw new Exception('Cannot create topic without group_id');
     }
     /*
     $this->getParentGroup()->setFromArray(array(
     
     ))->save();
     */
     parent::_insert();
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:15,代碼來源:Topic.php

示例6: _insert

 protected function _insert()
 {
     if (empty($this->forum_id)) {
         throw new Forum_Model_Exception('Cannot have a topic without a forum');
     }
     if (empty($this->user_id)) {
         throw new Forum_Model_Exception('Cannot have a topic without a user');
     }
     // Increment parent topic count
     $forum = $this->getParent();
     $forum->topic_count = new Zend_Db_Expr('topic_count + 1');
     $forum->modified_date = date('Y-m-d H:i:s');
     $forum->save();
     parent::_insert();
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:15,代碼來源:Topic.php

示例7: _insert

 protected function _insert()
 {
     if (!$this->event_id) {
         throw new Exception('Cannot create post without event_id');
     }
     if (!$this->topic_id) {
         throw new Exception('Cannot create post without topic_id');
     }
     // Update topic
     $table = Engine_Api::_()->getDbtable('topics', 'event');
     $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::_insert();
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:19,代碼來源:Post.php

示例8: _insert

 protected function _insert()
 {
     parent::_insert();
     $settings = Engine_Api::_()->getApi('settings', 'core');
     // Set defaults, process etc
     $this->salt = (string) rand(1000000, 9999999);
     $this->password = md5($settings->getSetting('core.secret', 'staticSalt') . $this->password . $this->salt);
     $this->level_id = Engine_Api::_()->getItemTable('authorization_level')->getDefaultLevel()->level_id;
     if (empty($this->_modifiedFields['timezone'])) {
         $this->timezone = $settings->getSetting('tcore.locale.timezone', 'America/Los_Angeles');
     }
     if (empty($this->_modifiedFields['locale'])) {
         $this->locale = $settings->getSetting('core.locale.locale', 'auto');
     }
     if (empty($this->_modifiedFields['language'])) {
         $this->language = $settings->getSetting('core.locale.language', 'en_US');
     }
     $this->enabled = (int) ($settings->getSetting('user.signup.approve', 1) == 1);
     $this->verified = (int) ($settings->getSetting('user.signup.verifyemail', 1) < 2);
     //    $this->invites_used = 0;
     $this->search = true;
     $this->creation_ip = ip2long($_SERVER['REMOTE_ADDR']);
     //$this->verify_code = md5($this->salt).uniqid(mt_rand(), true);
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:24,代碼來源:User.php

示例9: _insert

 protected function _insert()
 {
     $settings = Engine_Api::_()->getApi('settings', 'core');
     // These need to be done first so the hook can see them
     $this->level_id = Engine_Api::_()->getItemTable('authorization_level')->getDefaultLevel()->level_id;
     $this->approved = (int) ($settings->getSetting('user.signup.approve', 1) == 1);
     $this->verified = (int) ($settings->getSetting('user.signup.verifyemail', 1) < 2);
     $this->enabled = $this->approved && $this->verified;
     $this->search = true;
     if (empty($this->_modifiedFields['timezone'])) {
         $this->timezone = $settings->getSetting('core.locale.timezone', 'America/Los_Angeles');
     }
     if (empty($this->_modifiedFields['locale'])) {
         $this->locale = $settings->getSetting('core.locale.locale', 'auto');
     }
     if (empty($this->_modifiedFields['language'])) {
         $this->language = $settings->getSetting('core.locale.language', 'en_US');
     }
     if ('cli' !== PHP_SAPI) {
         // No CLI
         // Get ip address
         $db = $this->getTable()->getAdapter();
         $ipObj = new Engine_IP();
         $ipExpr = new Zend_Db_Expr($db->quoteInto('UNHEX(?)', bin2hex($ipObj->toBinary())));
         $this->creation_ip = $ipExpr;
     }
     // Set defaults, process etc
     $this->salt = (string) rand(1000000, 9999999);
     if (!empty($this->password)) {
         $this->password = md5($settings->getSetting('core.secret', 'staticSalt') . $this->password . $this->salt);
     } else {
         $this->password = '';
     }
     // The hook will be called here
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:36,代碼來源:User.php

示例10: _insert

 protected function _insert()
 {
     if (null === $this->search) {
         $this->search = 1;
     }
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:7,代碼來源:Poll.php

示例11: _insert

 protected function _insert()
 {
     $collection = $this->getCollection();
     if ($collection && isset($collection->collectible_count)) {
         $collection->collectible_count++;
         $collection->save();
     }
     parent::_insert();
 }
開發者ID:febryantosulistyo,項目名稱:ClassicSocial,代碼行數:9,代碼來源:Collectible.php

示例12: _insert

 protected function _insert()
 {
     parent::_insert();
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:4,代碼來源:Poll.php


注:本文中的Core_Model_Item_Abstract::_insert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。