/** * getDataVersion */ public function getDataVersion() { if (is_numeric($GLOBALS['onxshop_conf']['common_configuration']['api_data_version'])) { /** * read from config */ $data_version = $GLOBALS['onxshop_conf']['common_configuration']['api_data_version']; } else { /** * return latest revision ID */ $Revision = new common_revision(); $data_version = $Revision->count(); // this should be max(id), but count will do } return (int) $data_version; }