<?php
/**
 * InterchangeStatus business
 *
 * @author Moises Heberle [moises@solis.coop.br]
 *
 * @version $Id$
 *
 * \b Maintainers \n
 * Eduardo Bonfandini [eduardo@solis.coop.br]
 * Jamiel Spezia [jamiel@solis.coop.br]
 * Luiz Gregory Filho [luiz@solis.coop.br]
 * Moises Heberle [moises@solis.coop.br]
 * Sandro Roberto Weisheimer [sandrow@solis.coop.br]
 *
 * @since
 * Class created on 20/02/2009
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2009 SOLIS - Cooperativa de Solucoes Livres \n
 *
 * \b License: \n
 * Licensed under GPL (for further details read the COPYING file or http://www.gnu.org/copyleft/gpl.html )
 *
 * \b History: \n
 * See history in SVN repository: http://gnuteca.solis.coop.br
 */
class BusinessGnuteca3BusInterchangeStatus extends GnutecaBusiness
{
    public $interchangeStatusId;
    public $description;
    public $interchangeTypeId;

    public $interchangeStatusIdS;
    public $descriptionS;
    public $interchangeTypeIdS;


    public function __construct()
    {
    	$table = 'gtcInterchangeStatus';
    	$pkeys = 'interchangeStatusId';
    	$cols  = 'description,
    	          interchangeTypeId';
        parent::__construct($table, $pkeys, $cols);
    }


    public function insertInterchangeStatus()
    {
        return $this->autoInsert();
    }


    public function updateInterchangeStatus()
    {
        return $this->autoUpdate();
    }


    public function getInterchangeStatus($interchangeStatusId)
    {
        $this->clear();
        return $this->autoGet($interchangeStatusId);
    }


    public function deleteInterchangeStatus($interchangeStatusId)
    {
        return $this->autoDelete($interchangeStatusId);
    }


    public function searchInterchangeStatus($toObject = FALSE)
    {
        $filters = array(
            'interchangeStatusId' => 'equals',
            'description'      => 'ilike',
            'interchangeTypeId'   => 'equals'
        );
        $this->clear();
        return $this->autoSearch($filters, $toObject);
    }


    public function listInterchangeStatus($interchangeTypeId = NULL)
    {
    	$this->clear();
    	if ($interchangeTypeId)
    	{
    		$this->setWhere('interchangeTypeId = ?');
    		$this->MSQL->addParameter($interchangeTypeId);
    	}
        return $this->autoList();
    }
}
?>
