/** * @param Match $match * @param bool $lazy if false - update all data, if true - only possible updated data */ public function update(Match $match, $lazy = true) { $db = Db::obtain(); $slots = $match->getAllSlots(); // update common match info $db->updatePDO(Db::realTablename('matches'), $match->getDataArray(), array('match_id' => $match->get('match_id'))); foreach ($slots as $slot) { // update accounts $db->updatePDO(Db::realTablename('users'), array('account_id' => $slot->get('account_id'), 'steamid' => Player::convertId($slot->get('account_id'))), array('account_id' => $slot->get('account_id'))); // update slots if (!$lazy) { $db->updatePDO(Db::realTablename('slots'), $slot->getDataArray(), array('match_id' => $slot->get('match_id'), 'player_slot' => $slot->get('player_slot'))); } } }