Exemple #1
0
 /**
  * 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);
 }
Exemple #2
0
 /**
  * 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);
 }