Whups_Query::stringToPath PHP Method

stringToPath() public static method

public static stringToPath ( $pathstring )
    public static function stringToPath($pathstring)
    {
        if (!strlen($pathstring)) {
            return array();
        }
        return explode(',', $pathstring);
    }

Usage Example

Esempio n. 1
0
 public function insertCriterion($pathstring, $criterion, $cvalue, $operator, $value)
 {
     $path = Whups_Query::stringToPath($pathstring);
     $qobj =& $this->query;
     $value = trim($value);
     if ($value[0] == '"') {
         // FIXME: The last character should be '"' as well.
         $value = substr($value, 1, -1);
     } else {
         $pn = $this->_getParameterName($value);
         if ($pn !== null) {
             $this->parameters[] = $pn;
         }
     }
     $newbranch = array('type' => Whups_Query::TYPE_CRITERION, 'criterion' => $criterion, 'cvalue' => $cvalue, 'operator' => $operator, 'value' => $value);
     $count = count($path);
     for ($i = 0; $i < $count; $i++) {
         $qobj =& $qobj['children'][$path[$i]];
     }
     $qobj['children'][] = $newbranch;
 }
All Usage Examples Of Whups_Query::stringToPath