Esempio n. 1
0
 private function visitGroup(PHPClass $class, Schema $schema, Group $group)
 {
     foreach ($group->getElements() as $childGroup) {
         if ($childGroup instanceof Group) {
             $this->visitGroup($class, $schema, $childGroup);
         } else {
             $property = $this->visitElement($class, $schema, $childGroup);
             $class->addProperty($property);
         }
     }
 }
Esempio n. 2
0
 public function __construct(Group $group)
 {
     parent::__construct($group->getSchema(), '');
     $this->wrapped = $group;
 }
Esempio n. 3
0
 public function addGroup(Group $group)
 {
     $this->groups[$group->getName()] = $group;
 }
Esempio n. 4
0
 private function loadGroup(Schema $schema, DOMElement $node)
 {
     $group = new Group($schema, $node->getAttribute("name"));
     $group->setDoc($this->getDocumentation($node));
     if ($node->hasAttribute("maxOccurs")) {
         $group->setMax($node->getAttribute("maxOccurs") == "unbounded" ? -1 : (int) $node->getAttribute("maxOccurs"));
     }
     if ($node->hasAttribute("minOccurs")) {
         $group->setMin((int) $node->getAttribute("minOccurs"));
     }
     $schema->addGroup($group);
     return function () use($group, $node) {
         foreach ($node->childNodes as $childNode) {
             switch ($childNode->localName) {
                 case 'sequence':
                 case 'choice':
                 case 'all':
                     $this->loadSequence($group, $childNode);
                     break;
             }
         }
     };
 }