예제 #1
0
 public function testConvertPathToClassNameWhenProvidingNestedNamespaces()
 {
     $file      = "./test/ODM/Document/Stub/City.php";
     $namespace = "test\ODM";
     
     $className = String::convertPathToClassName($file, $namespace);
     $this->assertEquals('\test\ODM\Document\Stub\City', $className);
 }
예제 #2
0
    public static function format(array $values)
    {
        if (count($values)) {
            return String::filterNonSQLChars(array_shift($values)) . ".";
        }

        return null;
    }
예제 #3
0
파일: Updates.php 프로젝트: Reinmar/Orient
    public static function format(array $values)
    {
        $string = "";

        foreach ($values as $key => $update) {
            $key = String::filterNonSQLChars($key);

            if ($key) {
                $string .= ' ' . $key . ' = "' . addslashes($update) . '",';
            }
        }

        return substr($string, 0, strlen($string) - 1);
    }
예제 #4
0
    public static function format(array $values)
    {
        $rids = array();

        foreach ($values as $key => $value) {
            $key        = String::filterNonSQLChars($key);
            $validator  = new RidValidator;
            $rid        = $validator->check($value, true);

            if ($key && $rid) {
                $rids[$key] = "$key = " . $rid;
            }
        }

        return count($rids) ? self::implode($rids) : null;
    }
예제 #5
0
    public static function format(array $values)
    {
        $updates    = array();
        $validator  = new RidValidator;
      
        foreach ($values as $map => $update) {
            $map = String::filterNonSQLChars($map);
            
            if ($map && is_array($update)) {
                foreach ($update as $key => $rid) {
                  $rid = $validator->check($rid, true);
                  $key = String::filterNonSQLChars($key);
                }
              
                $updates[$map] = "$map = '$key', $rid";
            }
        }

        return count($updates) ? self::implode($updates) : null;
    }
예제 #6
0
파일: Query.php 프로젝트: Reinmar/Orient
 /**
  * Filters the array values leaving intact regular characters a-z and
  * integers.
  *
  * @param   array $values
  * @return  array
  */
 protected static function filterRegularChars(array $values, $nonFilter = null)
 {
     return array_map(function ($arr) use ($nonFilter) {
                 return String::filterNonSQLChars($arr, $nonFilter);
             }, $values);
 }