<?php

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

    private $procedimento;
    private $convenio;

    

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

    /**
     * Method set_procedimento
     * Sample of usage: $var->procedimento = $object;
     * @param $object Instance of Procedimento
     */
    public function set_procedimento(Procedimento $object)
    {
        $this->procedimento = $object;
        $this->procedimento_id = $object->id;
    }

    /**
     * Method get_procedimento
     * Sample of usage: $var->procedimento->attribute;
     * @returns Procedimento instance
     */
    public function get_procedimento()
    {
    
        // loads the associated object
        if (empty($this->procedimento))
            $this->procedimento = new Procedimento($this->procedimento_id);
    
        // returns the associated object
        return $this->procedimento;
    }
    /**
     * 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;
    }

    
}

