/** * @param block_ajax_marking_query $query * @return void */ protected function alter_query(block_ajax_marking_query $query) { // This will add the select, which will get a zero as the groupid if we don't have a group membership at all. $query->add_select(array('column' => block_ajax_marking_get_countwrapper_groupid_sql(), 'alias' => 'id')); }
/** * Used when there is an ancestor node representing a coursemodule. * * @static * @param block_ajax_marking_query $query * @param int|string $groupid * @return void */ protected function alter_query(block_ajax_marking_query $query, $groupid) { $conditions = array('type' => 'AND', 'condition' => block_ajax_marking_get_countwrapper_groupid_sql() . ' = :groupid'); $query->add_where($conditions); $query->add_param('groupid', $groupid); }