/** * Assign 'xid' field if not set * @method beforeSave * @param {array} $modifiedFields * @return {array} */ function beforeSave($updatedFields) { if (!$this->retrieved) { if (!isset($updatedFields['xid'])) { $this->xid = $updatedFields['xid'] = self::db()->uniqueId(self::table(), 'xid', null, array('characters' => '0123456789abcdefghijklmnopqrstuvwxyz', 'length' => 7)); } } return parent::beforeSave($updatedFields); }
/** * Assign 'xid' field if not set * @method beforeSave * @param {array} $modifiedFields * @return {array} */ function beforeSave($updatedFields) { if (!$this->retrieved) { if (!isset($updatedFields['xid'])) { $this->xid = $updatedFields['xid'] = self::db()->uniqueId(self::table(), 'xid', null); } } return parent::beforeSave($updatedFields); }