Subversion-Projekte lars-tiefland.ci

Revision

Revision 1257 | Revision 2242 | 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 3.0.0
35
 * @since	Version 3.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 324... Zeile 324...
324
	protected function _update_batch($table, $values, $index)
324
	protected function _update_batch($table, $values, $index)
325
	{
325
	{
326
		$ids = array();
326
		$ids = array();
327
		foreach ($values as $key => $val)
327
		foreach ($values as $key => $val)
328
		{
328
		{
329
			$ids[] = $val[$index];
329
			$ids[] = $val[$index]['value'];
Zeile 330... Zeile 330...
330
 
330
 
331
			foreach (array_keys($val) as $field)
331
			foreach (array_keys($val) as $field)
332
			{
332
			{
333
				if ($field !== $index)
333
				if ($field !== $index)
334
				{
334
				{
335
					$final[$field][] = 'WHEN '.$val[$index].' THEN '.$val[$field];
335
					$final[$val[$field]['field']][] = 'WHEN '.$val[$index]['value'].' THEN '.$val[$field]['value'];
336
				}
336
				}
337
			}
337
			}
Zeile 338... Zeile 338...
338
		}
338
		}
339
 
339
 
340
		$cases = '';
340
		$cases = '';
341
		foreach ($final as $k => $v)
341
		foreach ($final as $k => $v)
342
		{
342
		{
343
			$cases .= $k.' = (CASE '.$index."\n"
343
			$cases .= $k.' = (CASE '.$val[$index]['field']."\n"
344
				.implode("\n", $v)."\n"
344
				.implode("\n", $v)."\n"
Zeile 345... Zeile 345...
345
				.'ELSE '.$k.' END), ';
345
				.'ELSE '.$k.' END), ';
Zeile 346... Zeile 346...
346
		}
346
		}
347
 
347
 
Zeile 348... Zeile 348...
348
		$this->where($index.' IN('.implode(',', $ids).')', NULL, FALSE);
348
		$this->where($val[$index]['field'].' IN('.implode(',', $ids).')', NULL, FALSE);