Example #1
0
 /**
  * 
  * @param string $orm orm类名或实例
  */
 function __construct($orm)
 {
     $this->orm_class = $orm;
     $annotation = new Common\OrmAnnotation($orm);
     $this->table_name = $annotation->getTableName();
     if (!$this->table_name) {
         Exception::noTableName();
     }
     $this->alias = $annotation->getTableAliasName();
     $this->fields = $annotation->getFields();
     $this->primary_keys = $annotation->getPrimaryKeys();
     $this->generators = $annotation->getGenerators();
     $this->queryBuilder = new \Doctrine\DBAL\Query\QueryBuilder($this->getConnection());
     $this->queryBuilder->select('*');
 }