/** * This transform function is called before the saving of the data in the source model and allows you to * change all data. * * @param \MUtil_Model_ModelAbstract $model The parent model * @param array $row Array containing row * @return array Row array containing (optionally) transformed data */ public function transformRowBeforeSave(\MUtil_Model_ModelAbstract $model, array $row) { $fields = $this->fieldsDefinition->processBeforeSave($row, $row); $row['gr2t_track_info'] = $this->fieldsDefinition->calculateFieldsInfo($fields); // Also save the calculated fields into the row (actual save is in transformRowAfterSave) $row = $fields + $row; return $row; }
/** * This transform function is called before the saving of the data in the source model and allows you to * change all data. * * @param \MUtil_Model_ModelAbstract $model The parent model * @param array $row Array containing row * @return array Row array containing (optionally) transformed data */ public function transformRowBeforeSave(\MUtil_Model_ModelAbstract $model, array $row) { if (!$this->tracker) { $this->tracker = $this->loader->getTracker(); } if (isset($row[$this->respTrackIdField]) && $row[$this->respTrackIdField]) { $respTrack = $this->tracker->getRespondentTrack($row[$this->respTrackIdField]); $fields = $respTrack->processFieldsBeforeSave($row); $row['gr2t_track_info'] = $this->fieldsDefinition->calculateFieldsInfo($fields); // Also save the calculated fields into the row (actual save is in transformRowAfterSave) return $fields + $row; } return $row; }
/** * Is the field an appointment type * * @param string $fieldName * @return boolean */ public function isAppointmentField($fieldName) { return $this->_fieldsDefinition->isAppointment($fieldName); }