/** * Create a FieldRangeConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. * @param string $datatype Constraint datatype. * @param string $facet Whether constraint should be faceted ('true' or 'false'). * @param string $field Field name. */ public function __construct($name, $datatype, $facet = 'true', $field) { $this->field = (string) $field; $this->datatype = (string) $datatype; $this->facet = (string) $facet; parent::__construct($name); }
/** * Create a PathRangeConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. * @param string $datatype Constraint datatype. * @param string $facet Whether constraint should be faceted ('true' or 'false'). * @param string $elem Path expression (e.g., '/publication/my:meta/my:year'). */ public function __construct($name, $datatype, $facet = 'true', $path) { $this->path = (string) $path; $this->datatype = (string) $datatype; $this->facet = (string) $facet; parent::__construct($name); }
/** * Create a ValueConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. * @param string $elem Element name. * @param string $ns An element namespace. * @param string $attr Attribute name. * @param string $attrNs An attribute namespace. */ public function __construct($name, $elem, $ns = '', $attr = '', $attrNs = '') { $this->elem = (string) $elem; $this->ns = (string) $ns; $this->attr = (string) $attr; $this->attrNs = (string) $attrNs; parent::__construct($name); }
/** * Create a RangeConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. * @param string $datatype Constraint datatype. * @param string $facet Whether constraint should be faceted ('true' or 'false'). * @param string $elem Name of the element. * @param string $ns Element namespace. * @param string $attr Attribute name. * @param string $attrNs An attribute namespace. */ public function __construct($name, $datatype, $facet = 'true', $elem, $ns = '', $attr = '', $attrNs = '') { $this->elem = (string) $elem; $this->ns = (string) $ns; $this->attr = (string) $attr; $this->attrNs = (string) $attrNs; $this->datatype = (string) $datatype; $this->facet = (string) $facet; $this->buckets = array(); parent::__construct($name); }
/** * Get string representation of this constraint. * * @return string */ public function toString() { return vsprintf('Traversable<%s>', [$this->valueConstraint->toString()]); }
/** * Create a FieldWordConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. * @param string $field Field name. */ public function __construct($name, $field) { $this->field = (string) $field; parent::__construct($name); }
/** * @return array */ public function getExpressionData() { $data = parent::getExpressionData(); $colCount = count($this->referenceColumn); $newSpecTypes = [self::TYPE_IDENTIFIER]; $values = [$this->referenceTable]; $data[0][0] .= $this->referenceSpecification[0]; if ($colCount) { $values = array_merge($values, $this->referenceColumn); $newSpecParts = array_fill(0, $colCount, '%s'); $newSpecTypes = array_merge($newSpecTypes, array_fill(0, $colCount, self::TYPE_IDENTIFIER)); $data[0][0] .= sprintf('(%s) ', implode(', ', $newSpecParts)); } $data[0][0] .= $this->referenceSpecification[1]; $values[] = $this->onDeleteRule; $values[] = $this->onUpdateRule; $newSpecTypes[] = self::TYPE_LITERAL; $newSpecTypes[] = self::TYPE_LITERAL; $data[0][1] = array_merge($data[0][1], $values); $data[0][2] = array_merge($data[0][2], $newSpecTypes); return $data; }
/** * Construct an instance of a InArrayConstraint. * * @param array $allowed */ public function __construct(array $allowed) { parent::__construct(); $this->allowed = $allowed; }
/** * @return NotNull */ public function __construct() { parent::__construct('not null'); }
public function __construct($columns = null, $name = null) { parent::__construct($columns); $this->name = $name; }
/** * Create a PropertiesConstraint object. * * @see http://docs.marklogic.com/search:search#opt-constraint * * @param string $name Constraint name. */ public function __construct($name) { parent::__construct($name); }
public function getViolationPayload() { return array_merge(parent::getViolationPayload(), array('member_of' => $this->arguments)); }