/**
  * @return WS_Model_Xml_Model
  */
 public function parse()
 {
     $xml = $this->config->getXml();
     $this->expectTag('model', $xml);
     $model = new WS_Model_Xml_Model();
     foreach ($xml as $node) {
         $model->addEntity($this->parseEntity($node));
     }
     return $model;
 }
Пример #2
0
 /**
  * Generates the class templates for the models concrete classes. Will return
  * an array of WS_Model_Template_Class objects.
  *
  * @return array
  */
 protected function generateModelConcreteClasses()
 {
     $classTpls = array();
     $entites = $this->model->getEntities();
     if ($this->model->hasEntites()) {
         foreach ($entites as $entity) {
             /* @var $entity WS_Model_Xml_Entity */
             $className = $entity->getName();
             $classTpl = $this->tplFactory->createClassTemplate();
             $classTpl->setName($entity->getName());
             $classTpl->setBaseClass($entity->getName() . self::BASE_CLASS_SUFFIX);
             $classTpls[] = $classTpl;
         }
     }
     return $classTpls;
 }