function toRow() { $arr = parent::toRow(); // fields to encrypt if (isset($arr['cc_number'])) { $arr['cc_number'] = preg_replace('/\\D+/', '', $arr['cc_number']); if (empty($arr['cc']) || $arr['cc_number'] != '0000000000000000') { $arr['cc'] = $this->maskCc($arr['cc_number']); } } foreach ($this->_encryptedFields as $f) { if (array_key_exists($f, $arr)) { $arr[$f] = $this->_table->encrypt($arr[$f]); } } return $arr; }
function toRow() { $arr = parent::toRow(); if (isset($arr['echeck_ban'])) { $arr['echeck_ban'] = preg_replace('/\\D+/', '', $arr['echeck_ban']); if (empty($arr['echeck'])) { $arr['echeck'] = $this->maskBan($arr['echeck_ban']); } } $arr['echeck_aba'] = preg_replace('/\\D+/', '', $arr['echeck_aba']); foreach ($this->_encryptedFields as $f) { if (array_key_exists($f, $arr)) { $arr[$f] = $this->_table->encrypt($arr[$f]); } } return $arr; }
/** * Convert currently set object variables to database record array * @return array */ public function toRow() { return $this->getTable()->customFields()->valuesToTable(parent::toRow()); }