Ejemplo n.º 1
0
 /**
  *  Fetch the node managed by this definition
  *
  *  @access public
  *  @return Faker\Components\Engine\Common\Composite\CompositeInterface the new node
  */
 public function getNode()
 {
     # construct the selector type
     $type = new SwapSelector();
     $type->setGenerator($this->generator);
     $type->setUtilities($this->utilities);
     $type->setLocale($this->locale);
     foreach ($this->attributes as $attribute => $value) {
         $type->setOption($attribute, $value);
     }
     $node = new SelectorNode('selectorNode', $this->eventDispatcher, $type);
     # return the composite generator selectorNode
     return $node;
 }
Ejemplo n.º 2
0
 /**
  *  Fetch the node managed by this definition
  *
  *  @access public
  *  @return Faker\Components\Engine\Common\Composite\CompositeInterface the new node
  */
 public function getNode()
 {
     # construct the selector type
     $type = new SwapSelector();
     $type->setGenerator($this->generator);
     $type->setUtilities($this->utilities);
     $type->setLocale($this->locale);
     foreach ($this->attributes as $attribute => $value) {
         $type->setOption($attribute, $value);
     }
     # register position managers
     foreach ($this->positionManagers as $mgr) {
         $type->registerSwap($mgr);
     }
     $node = new SelectorNode('selectorNode', $this->eventDispatcher, $type);
     # register children
     foreach ($this->children as $aNode) {
         $node->addChild($aNode);
     }
     # return the composite generator selectorNode
     return $node;
 }