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(); }
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(); }
protected function _insert() { if (!$this->event_id) { throw new Exception('Cannot create topic without event_id'); } /* $this->getParentEvent()->setFromArray(array( ))->save(); */ parent::_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(); }
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(); }
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(); }
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(); }
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); }
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(); }
protected function _insert() { if (null === $this->search) { $this->search = 1; } parent::_insert(); }
protected function _insert() { $collection = $this->getCollection(); if ($collection && isset($collection->collectible_count)) { $collection->collectible_count++; $collection->save(); } parent::_insert(); }
protected function _insert() { parent::_insert(); }