ServiceSchemaFactory.php 751 B

123456789101112131415161718192021222324252627
  1. <?php
  2. require_once 'XMLAttribute.php';
  3. require_once 'AttributeRule.php';
  4. require_once 'Option.php';
  5. class ServiceSchemaFactory
  6. {
  7. public static function createAttribute($id = null, $name = null, $type = null, $valueType = null)
  8. {
  9. $attribute = new XMLAttribute();
  10. $attribute->setId($id);
  11. $attribute->setName($name);
  12. $attribute->setType($type);
  13. $attribute->setValueType($valueType);
  14. return $attribute;
  15. }
  16. public static function createRule($type = null, $name = null, $value = null)
  17. {
  18. return new AttributeRule($type, $name, $value);
  19. }
  20. public static function createOption($displayName = null, $value = null)
  21. {
  22. return new Option($displayName, $value);
  23. }
  24. }