Subversion-Projekte lars-tiefland.ci

Revision

Revision 1257 | Revision 2107 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1257 Revision 2049
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.3.0
35
 * @since	Version 1.3.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 548... Zeile 548...
548
	protected function _update_batch($table, $values, $index)
548
	protected function _update_batch($table, $values, $index)
549
	{
549
	{
550
		$ids = array();
550
		$ids = array();
551
		foreach ($values as $key => $val)
551
		foreach ($values as $key => $val)
552
		{
552
		{
553
			$ids[] = $val[$index];
553
			$ids[] = $val[$index]['value'];
Zeile 554... Zeile 554...
554
 
554
 
555
			foreach (array_keys($val) as $field)
555
			foreach (array_keys($val) as $field)
556
			{
556
			{
557
				if ($field !== $index)
557
				if ($field !== $index)
558
				{
558
				{
559
					$final[$field][] = 'WHEN '.$val[$index].' THEN '.$val[$field];
559
					$final[$val[$field]['field']][] = 'WHEN '.$val[$index]['value'].' THEN '.$val[$field]['value'];
560
				}
560
				}
561
			}
561
			}
Zeile 562... Zeile 562...
562
		}
562
		}
563
 
563
 
564
		$cases = '';
564
		$cases = '';
565
		foreach ($final as $k => $v)
565
		foreach ($final as $k => $v)
566
		{
566
		{
567
			$cases .= $k.' = (CASE '.$index."\n"
567
			$cases .= $k.' = (CASE '.$val[$index]['field']."\n"
568
				.implode("\n", $v)."\n"
568
				.implode("\n", $v)."\n"
Zeile 569... Zeile 569...
569
				.'ELSE '.$k.' END), ';
569
				.'ELSE '.$k.' END), ';
Zeile 570... Zeile 570...
570
		}
570
		}
571
 
571
 
Zeile 572... Zeile 572...
572
		$this->where($index.' IN('.implode(',', $ids).')', NULL, FALSE);
572
		$this->where($val[$index]['field'].' IN('.implode(',', $ids).')', NULL, FALSE);