$s) { if (is_string($s)) $subfilters[$key] = new Zend_Ldap_Filter_String($s); else if (!($s instanceof Zend_Ldap_Filter_Abstract)) { /** * @see Zend_Ldap_Filter_Exception */ #require_once 'Zend/Ldap/Filter/Exception.php'; throw new Zend_Ldap_Filter_Exception('Only strings or Zend_Ldap_Filter_Abstract allowed.'); } } $this->_subfilters = $subfilters; $this->_symbol = $symbol; } /** * Adds a filter to this grouping filter. * * @param Zend_Ldap_Filter_Abstract $filter * @return Zend_Ldap_Filter_Logical */ public function addFilter(Zend_Ldap_Filter_Abstract $filter) { $new = clone $this; $new->_subfilters[] = $filter; return $new; } /** * Returns a string representation of the filter. * * @return string */ public function toString() { $return = '(' . $this->_symbol; foreach ($this->_subfilters as $sub) $return .= $sub->toString(); $return .= ')'; return $return; } }