/** * Integrate field loading en showing and editing * * @param \MUtil_Model_ModelAbstract $model * @param boolean $addDependency True when editing, can be false in all other cases * @param string $respTrackId Optional Database column name where Respondent Track Id is set * @return \Gems_Tracker_Engine_TrackEngineAbstract */ public function addFieldsToModel(\MUtil_Model_ModelAbstract $model, $addDependency = true, $respTrackId = false) { if ($this->_fieldsDefinition->exists) { // Add the data to the load / save $transformer = new AddTrackFieldsTransformer($this->loader, $this->_fieldsDefinition, $respTrackId); $model->addTransformer($transformer); if ($addDependency) { $dependency = $this->_fieldsDefinition->getDataModelDependency(); if ($dependency instanceof DependencyInterface) { $model->addDependency($dependency); } } } return $this; }