/** * @param string Type of the Value given * @param mixed Data that the value should contain */ public function __construct($type, $data) { if ('Binary' === $type) { throw new jackalope_NotImplementedException('Binaries not implemented'); } $this->type = PHPCR_PropertyType::valueFromName($type); $this->data = $data; }
public function __construct($data, $path, jackalope_Session $session, jackalope_ObjectManager $objectManager) { parent::__construct(null, $path, $session, $objectManager); $this->type = PHPCR_PropertyType::valueFromName($data['type']); if (is_array($data['value'])) { $this->isMultiple = true; $this->value = array(); foreach ($data['value'] as $value) { array_push($this->value, jackalope_Factory::get('Value', array($data['type'], $value))); } } else { $this->value = jackalope_Factory::get('Value', array($data['type'], $data['value'])); } }
public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager) { parent::__construct($node, $nodeTypeManager); $this->requiredType = PHPCR_PropertyType::valueFromName($node->getAttribute('requiredType')); $this->isMultiple = jackalope_Helper::getBoolAttribute($node, 'multiple'); $this->isFullTextSearchable = jackalope_Helper::getBoolAttribute($node, 'fullTextSearchable'); $this->isQueryOrderable = jackalope_Helper::getBoolAttribute($node, 'queryOrderable'); $xp = new DOMXpath($node->ownerDocument); $valueConstraints = $xp->query('valueConstraints/valueConstraint', $node); foreach ($valueConstraints as $valueConstraint) { array_push($this->valueConstraints, $valueConstraint->nodeValue); } $availableQueryOperators = $xp->query('availableQueryOperators/availableQueryOperator', $node); foreach ($availableQueryOperators as $availableQueryOperator) { array_push($this->availableQueryOperators, $availableQueryOperator->nodeValue); } $defaultValues = $xp->query('defaultValues/defaultValue', $node); foreach ($defaultValues as $defaultValue) { array_push($this->defaultValues, jackalope_Factory::get('Value', array(PHPCR_PropertyType::valueFromType($defaultValue->nodeValue), $defaultValue->nodeValue))); } }