/** * Load the list of sample attributes into a static variable. * By maintaining a single list of attributes we can track which have already * been output. * @param array $readAuth Read authorisation tokens. * @param integer $surveyId ID of the survey to load sample attributes for. */ protected static function loadSmpAttrs($readAuth, $surveyId) { if (!isset(self::$smpAttrs)) { $attrArgs = array('valuetable' => 'sample_attribute_value', 'attrtable' => 'sample_attribute', 'fieldprefix' => 'smpAttr', 'extraParams' => $readAuth, 'survey_id' => $surveyId); if (!empty($args['sample_method_id'])) { // Select only the custom attributes that are for this sample method. $attrOpts['sample_method_id'] = $args['sample_method_id']; } self::$smpAttrs = data_entry_helper::getAttributes($attrArgs, false); } }