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); }