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); } } }
public function __construct(Group $group) { parent::__construct($group->getSchema(), ''); $this->wrapped = $group; }
public function addGroup(Group $group) { $this->groups[$group->getName()] = $group; }
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; } } }; }