Subversion Repositories oidplus

Rev

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

Rev 68 Rev 83
Line 24... Line 24...
24
                        if ($obj = $ot::parse($node_id)) return $obj;
24
                        if ($obj = $ot::parse($node_id)) return $obj;
25
                }
25
                }
26
                return null;
26
                return null;
27
        }
27
        }
28
 
28
 
-
 
29
        public function getOid() {
-
 
30
                if ($this->ns() == 'oid') {
-
 
31
                        return $this->getDotNotation();
-
 
32
                } else {
-
 
33
                        return OIDplus::system_id(true) . '.' . smallhash($this->nodeId());
-
 
34
                }
-
 
35
        }
-
 
36
 
29
        public abstract static function objectTypeTitle();
37
        public abstract static function objectTypeTitle();
30
 
38
 
31
        public abstract static function objectTypeTitleShort();
39
        public abstract static function objectTypeTitleShort();
32
 
40
 
33
        public abstract static function ns();
41
        public abstract static function ns();
Line 65... Line 73...
65
                                }
73
                                }
66
                        }
74
                        }
67
                } else {
75
                } else {
68
                        $res = OIDplus::db()->query("select oChild.id as id from ".OIDPLUS_TABLENAME_PREFIX."objects as oChild ".
76
                        $res = OIDplus::db()->query("select oChild.id as id from ".OIDPLUS_TABLENAME_PREFIX."objects as oChild ".
69
                                                    "left join ".OIDPLUS_TABLENAME_PREFIX."objects as oParent on oChild.parent = oParent.id ".
77
                                                    "left join ".OIDPLUS_TABLENAME_PREFIX."objects as oParent on oChild.parent = oParent.id ".
70
                                                    "where ifnull(oParent.ra_email,'') <> '".OIDplus::db()->real_escape_string($ra_email)."' and oChild.ra_email = '".OIDplus::db()->real_escape_string($ra_email)."' ".
78
                                                    "where (ifnull(oParent.ra_email,'') <> '".OIDplus::db()->real_escape_string($ra_email)."' and ifnull(oChild.ra_email,'') = '".OIDplus::db()->real_escape_string($ra_email)."') or ".
-
 
79
                                                    "      (oParent.ra_email is null and ifnull(oChild.ra_email,'') = '".OIDplus::db()->real_escape_string($ra_email)."') ".
71
                                                    "order by ".OIDplus::db()->natOrder('oChild.id'));
80
                                                    "order by ".OIDplus::db()->natOrder('oChild.id'));
72
                        while ($row = OIDplus::db()->fetch_array($res)) {
81
                        while ($row = OIDplus::db()->fetch_array($res)) {
73
                                $x = self::parse($row['id']); // can be FALSE if namespace was disabled
82
                                $x = self::parse($row['id']); // can be FALSE if namespace was disabled
74
                                if ($x) $out[] = self::parse($row['id']);
83
                                if ($x) $out[] = self::parse($row['id']);
75
                        }
84
                        }