public function __construct($tplFile)
 {
     parent::__construct($tplFile);
     $this->arguments = array();
 }
 public function __construct($tplFile)
 {
     parent::__construct($tplFile);
     $this->annotations = array();
 }
Example #3
0
 public function __construct($tplFile)
 {
     parent::__construct($tplFile);
     $this->properties = array();
     $this->methods = array();
 }
 /**
  * Generates the models base class constructor.
  *
  * The base class constructor provides an array with all property names to its
  * parent constructor (@see WS_Model_AbstractBase).
  *
  * @param WS_Model_Xml_Entity $entity The entity holds the properties with their names.
  *
  * @return WS_Model_Template_Method
  */
 protected function generateBaseClassConstructor(WS_Model_Xml_Entity $entity)
 {
     $methodTpl = $this->generateMethod('__construct', WS_Model_Template_Abstract::MODIFIER_PUBLIC);
     $argument = $this->tplFactory->createArgumentTemplate();
     $argument->setName('data');
     $argument->setDefault('null');
     $methodTpl->addArgument($argument);
     $body = 'parent::__construct(array(';
     if ($entity->countProperties()) {
         $body .= PHP_EOL;
         $index = 0;
         foreach ($entity->getProperties() as $property) {
             /* @var $property WS_Model_Xml_Property */
             if ($index > 0) {
                 $body .= ',' . PHP_EOL;
             }
             $body .= WS_Model_Template_Abstract::getIndentation(3);
             $body .= "'{$property->getName()}'";
             $index++;
         }
         $body .= PHP_EOL . WS_Model_Template_Abstract::getIndentation(2);
     }
     $body .= '), $data);';
     $methodTpl->setBody($body);
     return $methodTpl;
 }