/** * Retrieves the attribute field names from the related token table * * @param mixed $surveyid The survey ID * @return array The fieldnames */ public static function getAttributeFieldNames(LimeSurvey $survey) { global $dbprefix, $connect; if ($survey->getDbConnection()->schema->getTable('tokens_' . $survey->sid) === null) { return array(); } $tokenfieldnames = array_values($survey->getDbConnection()->createCommand("SHOW COLUMNS FROM lime_tokens_{$survey->sid}")->queryColumn()); return array_filter($tokenfieldnames, function ($fieldname) { if (strpos($fieldname, 'attribute_') === false) { return false; } else { return true; } }); }