ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDBUpdate3004.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
9{
10 public static function createPathFromId($a_container_id, $a_name)
11 {
12 $max_exponent = 3;
13 $st_factor = 100;
14
15 $path = array();
16 $found = false;
17 $num = $a_container_id;
18 for ($i = $max_exponent; $i > 0;$i--) {
19 $factor = pow($st_factor, $i);
20 if (($tmp = (int) ($num / $factor)) or $found) {
21 $path[] = $tmp;
22 $num = $num % $factor;
23 $found = true;
24 }
25 }
26
27 if (count($path)) {
28 $path_string = (implode('/', $path) . '/');
29 }
30 return $path_string . $a_name . '_' . $a_container_id;
31 }
32}
An exception for terminatinating execution or to throw for unit testing.
Update class for step 3004.
static createPathFromId($a_container_id, $a_name)
$i
Definition: disco.tpl.php:19