*
* @param string $field The field to apply the constraint to
* @param Horde_Constraint $constraint The constraint to apply
+ *
+ * @return Horde_Log_Filter_Constraint A reference to $this to allow method chaining
*/
public function addConstraint($field, Horde_Constraint $constraint)
{
} else {
$this->_constraints[$field] = $constraint;
}
+ return $this;
}
/**
*
* @param string $field The name of the field that should be part of the event
* @param string $regex The regular expression to filter by
+ * @return Horde_Log_Filter_Constraint A reference to $this to allow method chaining
*/
public function addRegex($field, $regex)
{
$constraint = new Horde_Constraint_PregMatch($regex);
- $this->addConstraint($field, $constraint);
+ return $this->addConstraint($field, $constraint);
}
/**
* If the field does not exist on the event, then it is filtered.
*
* @param string $field The name of the field that should be part of the event
+ * @return Horde_Log_Filter_Constraint A reference to $this to allow method chaining
*/
public function addRequiredField($field)
{
$notNull = new Horde_Constraint_Not(new Horde_Constraint_Null());
- $this->addConstraint($field, $notNull);
+ return $this->addConstraint($field, $notNull);
}
/**
* Adds all arguments passed as required fields
+ *
+ * @return Horde_Log_Filter_Constraint A reference to $this to allow method chaining
*/
public function addRequiredFields()
{
foreach ($fields as $f) {
$this->addRequiredField($f);
}
+ return $this;
}
/**