Пример #1
0
 /**
  * Write the constraint to a XMLWriter instance.
  *
  * @param \XMLWriter $xml The XMLWriter to write to
  * @param \TYPO3\FLOW3\Package\MetaData\AbstractConstraint $constraint The constraint to write
  * @return void
  */
 protected static function writeConstraint(\XMLWriter $xml, \TYPO3\FLOW3\Package\MetaData\AbstractConstraint $constraint)
 {
     $xml->startElement($constraint->getConstraintScope());
     if (strlen($constraint->getMinVersion())) {
         $xml->writeAttribute('minVersion', $constraint->getMinVersion());
     }
     if (strlen($constraint->getMaxVersion())) {
         $xml->writeAttribute('maxVersion', $constraint->getMaxVersion());
     }
     switch ($constraint->getConstraintScope()) {
         case \TYPO3\FLOW3\Package\MetaData::CONSTRAINT_SCOPE_SYSTEM:
             if (strlen($constraint->getType())) {
                 $xml->writeAttribute('type', $constraint->getType());
             }
             break;
         case \TYPO3\FLOW3\Package\MetaData::CONSTRAINT_SCOPE_PACKAGE:
             break;
     }
     if (strlen($constraint->getValue())) {
         $xml->text($constraint->getValue());
     }
     $xml->endElement();
 }