Changeset 12070
- Timestamp:
- 10/08/08 14:28:29 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/isicsPropelNestedSetPositionPlugin/lib/validator/isicsValidatorPropelNestedSetPosition.class.php
r12066 r12070 75 75 if ($node->isNew()) 76 76 { 77 $criteria = new Criteria(); 78 $criteria->add(constant(get_class($node->getPeer()).'::SCOPE_COL'), $node->getScopeIdValue()); 79 if (call_user_func(array($node->getPeer(), 'doCount'), $criteria, $this->getOption('connection')) > 0) 77 $root_node = call_user_func(array($node->getPeer(), 'retrieveRoot'), $node->getScopeIdValue(), $this->getOption('connection')); 78 if (!is_null($root_node)) 80 79 { 81 80 throw new sfValidatorError($this, 'root node already exists', array('value' => $value)); … … 86 85 else if (!$node->isRoot()) 87 86 { 88 throw new sfValidatorError($this, 'root node already exists', array('value' => $value)); 87 throw new sfValidatorError($this, 'root node already exists', array('value' => $value)); 89 88 } 90 89 else