Subversion Repositories oidplus

Rev

Rev 975 | Rev 979 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 975 Rev 977
Line 358... Line 358...
358
                if (!file_exists($icon)) return null; // default icon (folder)
358
                if (!file_exists($icon)) return null; // default icon (folder)
359
 
359
 
360
                return $icon;
360
                return $icon;
361
        }
361
        }
362
 
362
 
363
        public static function exists($id) {
363
        public static function exists(string $id) {
364
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
364
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
365
                        $res = OIDplus::db()->query("select id from ###objects where id = ?", array($id));
365
                        $res = OIDplus::db()->query("select id from ###objects where id = ?", array($id));
366
                        return $res->any();
366
                        return $res->any();
367
                } else {
367
                } else {
368
                        self::buildObjectInformationCache();
368
                        self::buildObjectInformationCache();
Line 530... Line 530...
530
                if (is_numeric($distance)) return $distance === 0; // if the distance function is implemented, use it
530
                if (is_numeric($distance)) return $distance === 0; // if the distance function is implemented, use it
531
 
531
 
532
                return $this->nodeId() == $obj->nodeId(); // otherwise compare the node id case-sensitive
532
                return $this->nodeId() == $obj->nodeId(); // otherwise compare the node id case-sensitive
533
        }
533
        }
534
 
534
 
535
        public static function findFitting($id) {
535
        public static function findFitting(string $id) {
536
                $obj = OIDplusObject::parse($id);
536
                $obj = OIDplusObject::parse($id);
537
                if (!$obj) return false; // e.g. if ObjectType plugin is disabled
537
                if (!$obj) return false; // e.g. if ObjectType plugin is disabled
538
 
538
 
539
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
539
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
540
                        $res = OIDplus::db()->query("select id from ###objects where id like ?", array($obj->ns().':%'));
540
                        $res = OIDplus::db()->query("select id from ###objects where id like ?", array($obj->ns().':%'));