<?php

class ClinicaConvenio extends TRecord
{
    const TABLENAME  = 'clinica_convenio';
    const PRIMARYKEY = 'id';
    const IDPOLICY   =  'serial'; // {max, serial}

    private $clinica;
    private $convenio;

    

    /**
     * Constructor method
     */
    public function __construct($id = NULL, $callObjectLoad = TRUE)
    {
        parent::__construct($id, $callObjectLoad);
        parent::addAttribute('convenio_id');
        parent::addAttribute('clinica_id');
            
    }

    /**
     * Method set_clinica
     * Sample of usage: $var->clinica = $object;
     * @param $object Instance of Clinica
     */
    public function set_clinica(Clinica $object)
    {
        $this->clinica = $object;
        $this->clinica_id = $object->id;
    }

    /**
     * Method get_clinica
     * Sample of usage: $var->clinica->attribute;
     * @returns Clinica instance
     */
    public function get_clinica()
    {
    
        // loads the associated object
        if (empty($this->clinica))
            $this->clinica = new Clinica($this->clinica_id);
    
        // returns the associated object
        return $this->clinica;
    }
    /**
     * Method set_convenio
     * Sample of usage: $var->convenio = $object;
     * @param $object Instance of Convenio
     */
    public function set_convenio(Convenio $object)
    {
        $this->convenio = $object;
        $this->convenio_id = $object->id;
    }

    /**
     * Method get_convenio
     * Sample of usage: $var->convenio->attribute;
     * @returns Convenio instance
     */
    public function get_convenio()
    {
    
        // loads the associated object
        if (empty($this->convenio))
            $this->convenio = new Convenio($this->convenio_id);
    
        // returns the associated object
        return $this->convenio;
    }

    
}

