예제 #1
0
파일: CRUD.php 프로젝트: cal127/phpcrud
 public function __construct($orm, $fields)
 {
     $this->hash = self::hash($orm);
     $this->orm = is_string($orm) ? Model::factory($orm) : $orm;
     $this->calculateBaseFilter();
     $this->resetFilters();
     // build model names
     $this->model_name = $this->orm->getClassName();
     $this->short_model_name = ($len = strlen(Model::$auto_prefix_models)) ? substr($this->model_name, $len) : $this->model_name;
     // take care of fields
     $this->fields = self::parseFields($fields, $this->model_name);
 }