<?php
//namespace application\models\hclinica\models;

use application\models\MainModel;
use application\models\hclinica\tables\Persona;
use application\models\MyModel;

class PersonaModel extends MyModel
{
    /*private $db;
    private $table="persona";
    private $model;
    public function __construct(\CI_DB_mysqli_driver $driver)
    {
        $this->db=$driver;
        $this->model=new MainModel($driver, $this->table);
    }
    public function guardar(Persona $persona)
    {
        $this->model->guardar($persona, "idPersona");
    }
    public function getArrayById($idPersona)
    {
        return $this->model->consultarPorId("idPersona", $idPersona);
    }*/
    public function __construct()
    {
        $this->db_server=$this->conexion;
        $this->table="persona";
        $this->idTable="idPersona";
    }
    public function guardarRegistro(&$datos)
    {
        $this->guardarArray($datos, $this->idTable);
    }
    public function getPersonaById($idPersona)
    {
        return $this->getArrayById($this->idTable, $idPersona);
    }
    public function guardarPersona($persona)
    {
        $this->guardarObjeto($persona);
    }
}

