syntax)) { return; } require_once 'DataObjects/Syntax.php'; $this->syntaxObject = new DataObjects_Syntax; $this->syntaxObject->get('uid',$this->syntax); } function toArray() { foreach(get_object_vars($this) as $k=>$v) { if ($k{0} == '_') { continue; } $ret[$k] = $v; } return $ret; } var $matchingObject = false; var $equalityObject = false; function getMatching() { require_once 'DataObjects/Matching.php'; if (!empty($this->equality)) { //echo "LOOKING FOR EQU: {$this->equality}"; $this->equalityObject = new DataObjects_Matching; $this->equalityObject->get('cn',$this->equality); //$this->equalityObject->getSyntax(); } if (!empty($this->substr)) { $this->substrObject = new DataObjects_Matching; $this->substrObject->get('cn', $this->substr); //$this->substrObject->getSyntax(); } } function getSup() { // get inherited values if (empty($this->sup)) { return; } //echo "GETTING SUP {$this->sup}"; $child = new DataObjects_Attribute; $child->get('cn', $this->sup); $child->getSup(); // it can inherit.. foreach(array('equality','substr','syntax','singleValue') as $k) { //echo "check $k"; if (empty($this->$k) && !empty($child->$k)) { //echo "using $k"; $this->$k = $child->$k; } } } var $usedBy = Array(); function buildUsedBy() { require_once 'DataObjects/Objectclass.php'; // DB_DataObjecT::debugLevel(1); $t = new DataObjects_ObjectClass; $t->selectAdd(); $t->selectAdd('cn'); $t->whereAdd("may like '%:{$this->cn}:%' OR must like '%:{$this->cn}:%'"); $t->find(); while ($t->fetch()) { $this->usedBy[] = clone($t); } } function toBNC() { $sup = $this->sup ? "\nSUP {$this->sup}" : ''; $eq = $this->equality ? "\nEQUALITY " .$this->equality : ''; $sy = $this->syntax ? "\nSYNTAX " .$this->syntax : ''; return "{$this->uid} NAME '{$this->cn}' {$sup} {$eq} {$sq}"; } function likeAdd($k,$v) { //DB_DataObject::debugLevel(1); //echo $k; switch($k) { case 'search': if (strlen(trim($v))) { $this->whereAdd("cn like '%".$this->escape($v)."%'"); } break; } } } ?>