Detailed Description
Definition at line 13 of file PmPathManager.php.
Member Function Documentation
static appendToPath |
( |
|
$path, |
|
|
|
$id |
|
) |
| |
|
static |
Appends the given ID (denoting an element) to the given path
- Parameters:
-
- Returns:
- string the full path including the new element
Definition at line 22 of file PmPathManager.php.
{
if(strlen($path) > 0 && $path[strlen($path) -1] != $separator)
$path .= $separator;
return $path.$id.self::getSeparator();
}
static buildMultiplePathCondition |
( |
|
$field, |
|
|
|
$paths, |
|
|
|
$additionalCondition = '' |
|
) |
| |
|
static |
Builds an sql-condition like: ($field LIKE [...] [AND condition]) OR ($field LIKE [...] [AND condition]) for all the given paths
- Parameters:
-
string | $field | the field to match (for example: path) |
| array[string] | $paths |
string | $additionalCondition | If given, this will be used as an additional condition to every single path-like-condition (bound with and) Occurences of :path will be replaced with the provided path |
- Returns:
- string the condition
Definition at line 59 of file PmPathManager.php.
{
$condition = '';
foreach($paths as $path){
if(strlen($condition) != 0)
$condition .= ' OR ';
$condition .= " (".$field." REGEXP CONCAT('^', '".$path."') ".
($additionalCondition ? ' AND '.str_replace(':path', $path, $additionalCondition) : '')
." ) ";
}
return $condition;
}
static getParentPath |
( |
|
$path | ) |
|
|
static |
Returns the parent path of the given path and the ID of the parent
- Parameters:
-
array[string | path, string ID] $path |
Definition at line 33 of file PmPathManager.php.
{
if($pos == strlen($path) - 1 && strlen($path) > 1 ){
$path = substr($path, 0, -1);
}
$id = substr($path, $pos + ($pos !== false ? 1 : 0));
$newPath = substr($path, 0, $pos);
return array('path' => $newPath,'id' => $id);
}
The documentation for this class was generated from the following file:
- D:/Projekte/Web/exportAcl/acl/components/strategies/nestedSet/pathMaterialization/PmPathManager.php