protected function _beforeInsert() { parent::_beforeInsert(); if (!$this->visible) { $this->visible = 0; } }
protected function _beforeInsert() { parent::_beforeInsert(); //access $this->_row-> instead of $this, else we get sibling columns $data = array(); foreach ($this->_row->getDirtyColumns() as $c) { $data[$c] = $this->_row->{$c}; } $returnedData = $this->getModel()->synchronizeAndInsertRow($data); foreach ($returnedData as $k => $v) { //parent aufrufen da die primaryKey exception ignoriert werden soll //und doSynOnUpdate nicht benötigt wird parent::__set($k, $v); } }
protected function _beforeInsert() { parent::_beforeInsert(); $this->getModel()->lockCreateUser(); if (Kwf_Registry::get('userModel')->mailExists($this->email)) { $this->getModel()->unlockCreateUser(); throw new Kwf_ClientException(trlKwf('An account with this email address already exists')); } $this->created = date('Y-m-d H:i:s'); $this->deleted = 0; if (!$this->password) { $this->password = ''; } $authMethods = $this->getModel()->getAuthMethods(); $authMethods['password']->generatePasswordSalt($this); if (!$this->gender) { $this->gender = ''; } }
protected function _beforeInsert() { parent::_beforeInsert(); $this->insert_date = date('Y-m-d H:i:s'); }