Example #1
0
 public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager)
 {
     parent::__construct($node, $nodeTypeManager);
     $this->allowsSameNameSiblings = jackalope_Helper::getBoolAttribute($node, 'sameNameSiblings');
     $this->defaultPrimaryTypeName = $node->getAttribute('defaultPrimaryType');
     if (empty($this->defaultPrimaryTypeName)) {
         $this->defaultPrimaryTypeName = null;
     }
     $xp = new DOMXpath($node->ownerDocument);
     $requiredPrimaryTypes = $xp->query('requiredPrimaryTypes/requiredPrimaryType', $node);
     if (0 < $requiredPrimaryTypes->length) {
         foreach ($requiredPrimaryTypes as $requiredPrimaryType) {
             array_push($this->requiredPrimaryTypeNames, $requiredPrimaryType->nodeValue);
         }
     } else {
         array_push($this->requiredPrimaryTypeNames, self::DEFAULT_PRIMARY_NODE);
     }
 }
Example #2
0
 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)));
     }
 }