/lib/model/om/BaseFcactcomHc.php
PHP | 745 lines | 509 code | 236 blank | 0 comment | 67 complexity | e172dee00c1aa9ff097f667aa70c1356 MD5 | raw file
- <?php
- abstract class BaseFcactcomHc extends BaseObject implements Persistent {
-
- protected static $peer;
-
- protected $codact;
-
- protected $desact;
-
- protected $mintri;
-
- protected $exoner;
-
- protected $minofac;
-
- protected $tipali;
-
- protected $porreb;
-
- protected $exepto;
-
- protected $rebaja;
-
- protected $exento;
-
- protected $tem;
-
- protected $afoact;
-
- protected $anoact;
-
- protected $id;
-
- protected $alreadyInSave = false;
-
- protected $alreadyInValidation = false;
-
- public function getCodact()
- {
- return trim($this->codact);
- }
-
- public function getDesact()
- {
- return trim($this->desact);
- }
-
- public function getMintri($val=false)
- {
- if($val) return number_format($this->mintri,2,',','.');
- else return $this->mintri;
- }
-
- public function getExoner()
- {
- return trim($this->exoner);
- }
-
- public function getMinofac()
- {
- return trim($this->minofac);
- }
-
- public function getTipali()
- {
- return trim($this->tipali);
- }
-
- public function getPorreb($val=false)
- {
- if($val) return number_format($this->porreb,2,',','.');
- else return $this->porreb;
- }
-
- public function getExepto()
- {
- return trim($this->exepto);
- }
-
- public function getRebaja()
- {
- return trim($this->rebaja);
- }
-
- public function getExento()
- {
- return trim($this->exento);
- }
-
- public function getTem($val=false)
- {
- if($val) return number_format($this->tem,2,',','.');
- else return $this->tem;
- }
-
- public function getAfoact($val=false)
- {
- if($val) return number_format($this->afoact,2,',','.');
- else return $this->afoact;
- }
-
- public function getAnoact()
- {
- return trim($this->anoact);
- }
-
- public function getId()
- {
- return $this->id;
- }
-
- public function setCodact($v)
- {
- if ($this->codact !== $v) {
- $this->codact = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::CODACT;
- }
-
- }
-
- public function setDesact($v)
- {
- if ($this->desact !== $v) {
- $this->desact = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::DESACT;
- }
-
- }
-
- public function setMintri($v)
- {
- if ($this->mintri !== $v) {
- $this->mintri = Herramientas::toFloat($v);
- $this->modifiedColumns[] = FcactcomHcPeer::MINTRI;
- }
-
- }
-
- public function setExoner($v)
- {
- if ($this->exoner !== $v) {
- $this->exoner = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::EXONER;
- }
-
- }
-
- public function setMinofac($v)
- {
- if ($this->minofac !== $v) {
- $this->minofac = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::MINOFAC;
- }
-
- }
-
- public function setTipali($v)
- {
- if ($this->tipali !== $v) {
- $this->tipali = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::TIPALI;
- }
-
- }
-
- public function setPorreb($v)
- {
- if ($this->porreb !== $v) {
- $this->porreb = Herramientas::toFloat($v);
- $this->modifiedColumns[] = FcactcomHcPeer::PORREB;
- }
-
- }
-
- public function setExepto($v)
- {
- if ($this->exepto !== $v) {
- $this->exepto = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::EXEPTO;
- }
-
- }
-
- public function setRebaja($v)
- {
- if ($this->rebaja !== $v) {
- $this->rebaja = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::REBAJA;
- }
-
- }
-
- public function setExento($v)
- {
- if ($this->exento !== $v) {
- $this->exento = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::EXENTO;
- }
-
- }
-
- public function setTem($v)
- {
- if ($this->tem !== $v) {
- $this->tem = Herramientas::toFloat($v);
- $this->modifiedColumns[] = FcactcomHcPeer::TEM;
- }
-
- }
-
- public function setAfoact($v)
- {
- if ($this->afoact !== $v) {
- $this->afoact = Herramientas::toFloat($v);
- $this->modifiedColumns[] = FcactcomHcPeer::AFOACT;
- }
-
- }
-
- public function setAnoact($v)
- {
- if ($this->anoact !== $v) {
- $this->anoact = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::ANOACT;
- }
-
- }
-
- public function setId($v)
- {
- if ($this->id !== $v) {
- $this->id = $v;
- $this->modifiedColumns[] = FcactcomHcPeer::ID;
- }
-
- }
-
- public function hydrate(ResultSet $rs, $startcol = 1)
- {
- try {
- $this->codact = $rs->getString($startcol + 0);
- $this->desact = $rs->getString($startcol + 1);
- $this->mintri = $rs->getFloat($startcol + 2);
- $this->exoner = $rs->getString($startcol + 3);
- $this->minofac = $rs->getString($startcol + 4);
- $this->tipali = $rs->getString($startcol + 5);
- $this->porreb = $rs->getFloat($startcol + 6);
- $this->exepto = $rs->getString($startcol + 7);
- $this->rebaja = $rs->getString($startcol + 8);
- $this->exento = $rs->getString($startcol + 9);
- $this->tem = $rs->getFloat($startcol + 10);
- $this->afoact = $rs->getFloat($startcol + 11);
- $this->anoact = $rs->getString($startcol + 12);
- $this->id = $rs->getInt($startcol + 13);
- $this->resetModified();
- $this->setNew(false);
- $this->afterHydrate();
- return $startcol + 14;
- } catch (Exception $e) {
- throw new PropelException("Error populating FcactcomHc object", $e);
- }
- }
- protected function afterHydrate()
- {
- }
-
-
- public function __call($m, $a)
- {
- $prefijo = substr($m,0,3);
- $metodo = strtolower(substr($m,3));
- if($prefijo=='get'){
- if(isset($this->$metodo)) return $this->$metodo;
- else return '';
- }elseif($prefijo=='set'){
- if(isset($this->$metodo)) $this->$metodo = $a[0];
- }else call_user_func_array($m, $a);
- }
-
- public function delete($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
- if ($con === null) {
- $con = Propel::getConnection(FcactcomHcPeer::DATABASE_NAME);
- }
- try {
- $con->begin();
- FcactcomHcPeer::doDelete($this, $con);
- $this->setDeleted(true);
- $con->commit();
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- public function save($con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
- if ($con === null) {
- $con = Propel::getConnection(FcactcomHcPeer::DATABASE_NAME);
- }
- try {
- $con->begin();
- $affectedRows = $this->doSave($con);
- $con->commit();
- return $affectedRows;
- } catch (PropelException $e) {
- $con->rollback();
- throw $e;
- }
- }
-
- protected function doSave($con)
- {
- $affectedRows = 0; if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
- if ($this->isModified()) {
- if ($this->isNew()) {
- $pk = FcactcomHcPeer::doInsert($this, $con);
- $affectedRows += 1;
- $this->setId($pk);
- $this->setNew(false);
- } else {
- $affectedRows += FcactcomHcPeer::doUpdate($this, $con);
- }
- $this->resetModified(); }
- $this->alreadyInSave = false;
- }
- return $affectedRows;
- }
-
- protected $validationFailures = array();
-
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
- return true;
- } else {
- $this->validationFailures = $res;
- return false;
- }
- }
-
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
- $failureMap = array();
- if (($retval = FcactcomHcPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
- $this->alreadyInValidation = false;
- }
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FcactcomHcPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->getByPosition($pos);
- }
-
- public function getByPosition($pos)
- {
- switch($pos) {
- case 0:
- return $this->getCodact();
- break;
- case 1:
- return $this->getDesact();
- break;
- case 2:
- return $this->getMintri();
- break;
- case 3:
- return $this->getExoner();
- break;
- case 4:
- return $this->getMinofac();
- break;
- case 5:
- return $this->getTipali();
- break;
- case 6:
- return $this->getPorreb();
- break;
- case 7:
- return $this->getExepto();
- break;
- case 8:
- return $this->getRebaja();
- break;
- case 9:
- return $this->getExento();
- break;
- case 10:
- return $this->getTem();
- break;
- case 11:
- return $this->getAfoact();
- break;
- case 12:
- return $this->getAnoact();
- break;
- case 13:
- return $this->getId();
- break;
- default:
- return null;
- break;
- } }
-
- public function toArray($keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FcactcomHcPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getCodact(),
- $keys[1] => $this->getDesact(),
- $keys[2] => $this->getMintri(),
- $keys[3] => $this->getExoner(),
- $keys[4] => $this->getMinofac(),
- $keys[5] => $this->getTipali(),
- $keys[6] => $this->getPorreb(),
- $keys[7] => $this->getExepto(),
- $keys[8] => $this->getRebaja(),
- $keys[9] => $this->getExento(),
- $keys[10] => $this->getTem(),
- $keys[11] => $this->getAfoact(),
- $keys[12] => $this->getAnoact(),
- $keys[13] => $this->getId(),
- );
- return $result;
- }
-
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = FcactcomHcPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- return $this->setByPosition($pos, $value);
- }
-
- public function setByPosition($pos, $value)
- {
- switch($pos) {
- case 0:
- $this->setCodact($value);
- break;
- case 1:
- $this->setDesact($value);
- break;
- case 2:
- $this->setMintri($value);
- break;
- case 3:
- $this->setExoner($value);
- break;
- case 4:
- $this->setMinofac($value);
- break;
- case 5:
- $this->setTipali($value);
- break;
- case 6:
- $this->setPorreb($value);
- break;
- case 7:
- $this->setExepto($value);
- break;
- case 8:
- $this->setRebaja($value);
- break;
- case 9:
- $this->setExento($value);
- break;
- case 10:
- $this->setTem($value);
- break;
- case 11:
- $this->setAfoact($value);
- break;
- case 12:
- $this->setAnoact($value);
- break;
- case 13:
- $this->setId($value);
- break;
- } }
-
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = FcactcomHcPeer::getFieldNames($keyType);
- if (array_key_exists($keys[0], $arr)) $this->setCodact($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setDesact($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setMintri($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setExoner($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setMinofac($arr[$keys[4]]);
- if (array_key_exists($keys[5], $arr)) $this->setTipali($arr[$keys[5]]);
- if (array_key_exists($keys[6], $arr)) $this->setPorreb($arr[$keys[6]]);
- if (array_key_exists($keys[7], $arr)) $this->setExepto($arr[$keys[7]]);
- if (array_key_exists($keys[8], $arr)) $this->setRebaja($arr[$keys[8]]);
- if (array_key_exists($keys[9], $arr)) $this->setExento($arr[$keys[9]]);
- if (array_key_exists($keys[10], $arr)) $this->setTem($arr[$keys[10]]);
- if (array_key_exists($keys[11], $arr)) $this->setAfoact($arr[$keys[11]]);
- if (array_key_exists($keys[12], $arr)) $this->setAnoact($arr[$keys[12]]);
- if (array_key_exists($keys[13], $arr)) $this->setId($arr[$keys[13]]);
- }
-
- public function buildCriteria()
- {
- $criteria = new Criteria(FcactcomHcPeer::DATABASE_NAME);
- if ($this->isColumnModified(FcactcomHcPeer::CODACT)) $criteria->add(FcactcomHcPeer::CODACT, $this->codact);
- if ($this->isColumnModified(FcactcomHcPeer::DESACT)) $criteria->add(FcactcomHcPeer::DESACT, $this->desact);
- if ($this->isColumnModified(FcactcomHcPeer::MINTRI)) $criteria->add(FcactcomHcPeer::MINTRI, $this->mintri);
- if ($this->isColumnModified(FcactcomHcPeer::EXONER)) $criteria->add(FcactcomHcPeer::EXONER, $this->exoner);
- if ($this->isColumnModified(FcactcomHcPeer::MINOFAC)) $criteria->add(FcactcomHcPeer::MINOFAC, $this->minofac);
- if ($this->isColumnModified(FcactcomHcPeer::TIPALI)) $criteria->add(FcactcomHcPeer::TIPALI, $this->tipali);
- if ($this->isColumnModified(FcactcomHcPeer::PORREB)) $criteria->add(FcactcomHcPeer::PORREB, $this->porreb);
- if ($this->isColumnModified(FcactcomHcPeer::EXEPTO)) $criteria->add(FcactcomHcPeer::EXEPTO, $this->exepto);
- if ($this->isColumnModified(FcactcomHcPeer::REBAJA)) $criteria->add(FcactcomHcPeer::REBAJA, $this->rebaja);
- if ($this->isColumnModified(FcactcomHcPeer::EXENTO)) $criteria->add(FcactcomHcPeer::EXENTO, $this->exento);
- if ($this->isColumnModified(FcactcomHcPeer::TEM)) $criteria->add(FcactcomHcPeer::TEM, $this->tem);
- if ($this->isColumnModified(FcactcomHcPeer::AFOACT)) $criteria->add(FcactcomHcPeer::AFOACT, $this->afoact);
- if ($this->isColumnModified(FcactcomHcPeer::ANOACT)) $criteria->add(FcactcomHcPeer::ANOACT, $this->anoact);
- if ($this->isColumnModified(FcactcomHcPeer::ID)) $criteria->add(FcactcomHcPeer::ID, $this->id);
- return $criteria;
- }
-
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(FcactcomHcPeer::DATABASE_NAME);
- $criteria->add(FcactcomHcPeer::ID, $this->id);
- return $criteria;
- }
-
- public function getPrimaryKey()
- {
- return $this->getId();
- }
-
- public function setPrimaryKey($key)
- {
- $this->setId($key);
- }
-
- public function copyInto($copyObj, $deepCopy = false)
- {
- $copyObj->setCodact($this->codact);
- $copyObj->setDesact($this->desact);
- $copyObj->setMintri($this->mintri);
- $copyObj->setExoner($this->exoner);
- $copyObj->setMinofac($this->minofac);
- $copyObj->setTipali($this->tipali);
- $copyObj->setPorreb($this->porreb);
- $copyObj->setExepto($this->exepto);
- $copyObj->setRebaja($this->rebaja);
- $copyObj->setExento($this->exento);
- $copyObj->setTem($this->tem);
- $copyObj->setAfoact($this->afoact);
- $copyObj->setAnoact($this->anoact);
- $copyObj->setNew(true);
- $copyObj->setId(NULL);
- }
-
- public function copy($deepCopy = false)
- {
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
- return $copyObj;
- }
-
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new FcactcomHcPeer();
- }
- return self::$peer;
- }
- }