public function delete(array $ids)
    {
        if (!count($ids)) {
            return;
        }
        $ids_str = implode(',', $ids);
        $db = Db::obtain();
        $slots = $db->fetchArrayPDO(
            'SELECT id FROM ' . Db::realTablename('slots') . ' WHERE match_id IN (' . $ids_str . ')',
            array()
        );
        $slotsFormatted = array();
        foreach ($slots as $slot) {
            array_push($slotsFormatted, $slot['id']);
        }
        if (count($slotsFormatted)) {
            $slots_str = implode(',', $slotsFormatted);
            $db->exec('DELETE FROM ' . Db::realTablename('ability_upgrades') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('additional_units') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('slots') . ' WHERE id IN (' . $slots_str . ')');
        }
        $db->exec('DELETE FROM ' . Db::realTablename('picks_bans') . ' WHERE match_id IN (' . $ids_str . ')');
        $db->exec('DELETE FROM ' . Db::realTablename('matches') . ' WHERE match_id IN (' . $ids_str . ')');
    }
public function delete(array $ids)
    {
        if (!count($ids)) {
            return;
        }
        $ids_str = implode(',', $ids);
        $db = Db::obtain();
        $slots = $db->fetchArrayPDO(
            'SELECT id FROM ' . Db::realTablename('slots') . ' WHERE match_id IN (' . $ids_str . ')',
            array()
        );
        $slotsFormatted = array();
        foreach ($slots as $slot) {
            array_push($slotsFormatted, $slot['id']);
        }
        if (count($slotsFormatted)) {
            $slots_str = implode(',', $slotsFormatted);
            $db->exec('DELETE FROM ' . Db::realTablename('ability_upgrades') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('additional_units') . ' WHERE slot_id IN (' . $slots_str . ')');
            $db->exec('DELETE FROM ' . Db::realTablename('slots') . ' WHERE id IN (' . $slots_str . ')');
        }
        $db->exec('DELETE FROM ' . Db::realTablename('picks_bans') . ' WHERE match_id IN (' . $ids_str . ')');
        $db->exec('DELETE FROM ' . Db::realTablename('matches') . ' WHERE match_id IN (' . $ids_str . ')');
    }
public function delete ( array $ ids ) { if ( ! count ( $ ids ) ) { return ; } $ ids_str = implode ( ',' , $ ids ) ; $ db = Db :: obtain ( ) ; $ slots = $ db -> fetchArrayPDO ( 'SELECT id FROM ' . Db :: realTablename ( 'slots' ) . ' WHERE match_id IN (' . $ ids_str . ')' , array ( ) ) ; $ slotsFormatted = array ( ) ; foreach ( $ slots as $ slot ) { array_push ( $ slotsFormatted , $ slot [ 'id' ] ) ; } if ( count ( $ slotsFormatted ) ) { $ slots_str = implode ( ',' , $ slotsFormatted ) ; $ db -> exec ( 'DELETE FROM ' . Db :: realTablename ( 'ability_upgrades' ) . ' WHERE slot_id IN (' . $ slots_str . ')' ) ; $ db -> exec ( 'DELETE FROM ' . Db :: realTablename ( 'additional_units' ) . ' WHERE slot_id IN (' . $ slots_str . ')' ) ; $ db -> exec ( 'DELETE FROM ' . Db :: realTablename ( 'slots' ) . ' WHERE id IN (' . $ slots_str . ')' ) ; } $ db -> exec ( 'DELETE FROM ' . Db :: realTablename ( 'picks_bans' ) . ' WHERE match_id IN (' . $ ids_str . ')' ) ; $ db -> exec ( 'DELETE FROM ' . Db :: realTablename ( 'matches' ) . ' WHERE match_id IN (' . $ ids_str . ')' ) ; }
Delete matches info from db
@param array $ids
Delete matches info from db