Exemple #1
0
 private static function __is_notset_key($key)
 {
     if (StringUtils::starts_with($key, self::NOTSET_KEY_PREFIX)) {
         return true;
     } else {
         return false;
     }
 }
Exemple #2
0
 static function clear()
 {
     $t = self::internalInit();
     $root_elements = $t->get("/");
     foreach ($root_elements as $k => $v) {
         if (!StringUtils::starts_with($k, "__")) {
             $t->remove($k);
         }
     }
 }
 public function setupByParams($do)
 {
     $fields = $this->__getAllFields();
     $pk_fields = $this->__getPrimaryKeyFields();
     $params_list = array();
     //tolgo le chiavi primarie
     foreach (ArrayUtils::delete_keys($fields, $pk_fields) as $fkey => $attribs) {
         if (Params::is_set($fkey)) {
             $params_list[$fkey] = Params::get($fkey);
         }
     }
     foreach (Params::keys() as $k) {
         if (StringUtils::starts_with($k, self::CHECK_PREFIX)) {
             $field_to_check = substr($k, strlen(self::CHECK_PREFIX));
             if (Params::is_set($field_to_check)) {
                 $params_list[$field_to_check] = true;
             } else {
                 $params_list[$field_to_check] = false;
             }
         }
     }
     return $this->setupWithMap($do, $params_list);
 }
Exemple #4
0
 function isParentOf($folder)
 {
     if ($folder instanceof Dir) {
         $d = $folder;
     } else {
         $d = new Dir($folder);
     }
     $path_a = $this->getPath();
     $path_b = $d->getPath();
     return StringUtils::starts_with($path_b, $path_a);
 }