setTable('cuentas'); $this->setProperties(['id', 'nombre', 'tipo']); } public function load(array $data_row): Model { return (new BaseModel()) ->setId($data_row['id']); } public function fetchByKey($key): Model { $query = "SELECT * FROM {$this->getTable()} WHERE `id` = ?"; return $this->load($this->getDatabase()->prepare($query)->execute($key)[0]); } public function delete(Model $model): void { $query = "DELETE FROM {$this->getTable()} WHERE `id` = ?"; $this->getDatabase()->prepare($query)->delete([$model->getId()]); } }