/** * Constructor, takes one or more object guids and classnames and constructs a collector accordingly. * * Attention: At least one of these arguments has to be a string * * @param mixed $guids One or more object guids * @param mixed $classes One or more target classes * @param string $direction incoming or outgoing */ public function __construct($guids, $classes, $direction = 'incoming') { $this->_set_direction($direction); if (is_string($guids)) { parent::__construct('org_openpsa_relatedto_dba', $this->_object_prefix . 'Guid', $guids); $this->initialize(); if (is_string($classes)) { $this->add_constraint($this->_other_prefix . 'Class', '=', $classes); } else { $this->add_constraint($this->_other_prefix . 'Class', 'IN', $classes); } } else { if (is_string($classes)) { parent::__construct('org_openpsa_relatedto_dba', $this->_other_prefix . 'Class', $classes); $this->initialize(); if (is_string($guids)) { $this->add_constraint($this->_object_prefix . 'Guid', '=', $guids); } else { $this->add_constraint($this->_object_prefix . 'Guid', 'IN', $guids); } } else { throw new midcom_error('None of the arguments was passed as a string'); } } //save target classes for later use if (is_string($classes)) { $this->_target_classes = array($classes); } else { $this->_target_classes = $classes; } $this->add_value_property($this->_other_prefix . 'Guid'); }