<?php
/**
 * gtcRulesToCompleteFieldsMarc 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]
 *
 * @since
 * Class created on 01/12/2008
 *
 * \b Organization: \n
 * SOLIS - Cooperativa de Solucoes Livres \n
 * The Gnuteca3 Development Team
 *
 * \b CopyLeft: \n
 * CopyLeft (L) 2008 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 to manipulate the basConfig table
 **/
class BusinessGnuteca3BusRulesToCompleteFieldsMarc extends GnutecaBusiness
{
    public $rulesToCompleteFieldsMarcId;
    public $category;
    public $originField;
    public $fateField;
    public $affectRecordsCompleted;

    public $rulesToCompleteFieldsMarcIdS;
    public $categoryS;
    public $originFieldS;
    public $fateFieldS;
    public $affectRecordsCompletedS;
    
    
    public function __construct()
    {
        $table = 'gtcRulesToCompleteFieldsMarc';
        $pkeys = 'rulesToCompleteFieldsMarcId';
        $cols  = 'category,
                  originField,
                  fateField,
                  affectRecordsCompleted';
        parent::__construct($table, $pkeys, $cols);
    }


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


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


    public function deleteRulesToCompleteFieldsMarc($rulesToCompleteFieldsMarcId)
    {
        return $this->autoDelete($rulesToCompleteFieldsMarcId);
    }


    public function getRulesToCompleteFieldsMarc($rulesToCompleteFieldsMarcId)
    {
        $this->clear();
        return $this->autoGet($rulesToCompleteFieldsMarcId);
    }


    public function searchRulesToCompleteFieldsMarc($object = false)
    {
        unset($this->rulesToCompleteFieldsMarcId); //estava ocorrendo bug pos-busca no formulario
        $this->clear();
        $filters = array(
            'rulesToCompleteFieldsMarcId' => 'equals',
            'category'                    => 'equals',
            'originField'                 => 'ilike',
            'fateField'                   => 'ilike',
            'affectRecordsCompleted'      => 'equals'
        );
        return $this->autoSearch($filters, $object);
    }


    public function listRulesToCompleteFieldsMarc()
    {
        return $this->autoList();
    }
}
?>
