Ejemplo n.º 1
0
 /**
  * @param string intfName
  */
 public function build($intfName)
 {
     $classPath = $this->config->daoClassPath;
     $className = $this->getDaoClassName($intfName);
     $path = $this->normalizePath("{$classPath}/{$className}.php");
     if (!file_exists(dirname($path))) {
         mkdir(dirname($path), 0777, true);
     }
     $ref = new \ReflectionClass($intfName);
     if ($this->watcher->outdated($ref->getFileName()) || $this->watcher->sqlOutdated($className::AccessRoute)) {
         $builder = new DaoBuilder($ref, $className);
         $builder->setParamCaseSensor(CaseSensor::{$this->config->paramCaseSensor}());
         $builder->setReturnCaseSensor(CaseSensor::{$this->config->returnCaseSensor}());
         $builder->prepare();
         file_put_contents($path, $builder->export(true));
     }
 }