/** * Finds records by attributes * @param type $where */ public function findBy($where, $cacheable = true, $fields = "*", $limit_from = "", $limit_to = "") { $find = $this->isInController($where); if ($find !== false) { return $this->rows[$find]; } $this->wheredone[] = $where; if ($where == "*") { $where = ""; } $associative = parent::findBy($where, $cacheable, $fields, $limit_from, $limit_to); //print_r($associative); $new_arr = $associative; /*foreach($associative as $key => $val){ $nome_id = ucwords($val->getKeyName()); $nome_metodo="get".str_replace(" ","",ucwords(str_replace("_"," ",$nome_id))); $new_arr[$val->$nome_metodo()] = $val; }*/ $this->rows[] = $new_arr; return $new_arr; //print_r($this->rows); }
/** * [checkCampiTable description] * @return [type] [description] */ public function checkCampiTable() { if (!$this->table) { return false; } $ct = new Table($this->table, true, false); if ($this->where) { $where = $this->where; } elseif ($this->where_object) { $where = $this->object_to_array(json_decode($this->where_object)); } $find = $ct->findBy($where, false, "*"); return $find; }