PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/lib/model/om/BaseFcactcomHc.php

https://github.com/cidesa/siga-universitario
PHP | 745 lines | 509 code | 236 blank | 0 comment | 67 complexity | e172dee00c1aa9ff097f667aa70c1356 MD5 | raw file
  1. <?php
  2. abstract class BaseFcactcomHc extends BaseObject implements Persistent {
  3. protected static $peer;
  4. protected $codact;
  5. protected $desact;
  6. protected $mintri;
  7. protected $exoner;
  8. protected $minofac;
  9. protected $tipali;
  10. protected $porreb;
  11. protected $exepto;
  12. protected $rebaja;
  13. protected $exento;
  14. protected $tem;
  15. protected $afoact;
  16. protected $anoact;
  17. protected $id;
  18. protected $alreadyInSave = false;
  19. protected $alreadyInValidation = false;
  20. public function getCodact()
  21. {
  22. return trim($this->codact);
  23. }
  24. public function getDesact()
  25. {
  26. return trim($this->desact);
  27. }
  28. public function getMintri($val=false)
  29. {
  30. if($val) return number_format($this->mintri,2,',','.');
  31. else return $this->mintri;
  32. }
  33. public function getExoner()
  34. {
  35. return trim($this->exoner);
  36. }
  37. public function getMinofac()
  38. {
  39. return trim($this->minofac);
  40. }
  41. public function getTipali()
  42. {
  43. return trim($this->tipali);
  44. }
  45. public function getPorreb($val=false)
  46. {
  47. if($val) return number_format($this->porreb,2,',','.');
  48. else return $this->porreb;
  49. }
  50. public function getExepto()
  51. {
  52. return trim($this->exepto);
  53. }
  54. public function getRebaja()
  55. {
  56. return trim($this->rebaja);
  57. }
  58. public function getExento()
  59. {
  60. return trim($this->exento);
  61. }
  62. public function getTem($val=false)
  63. {
  64. if($val) return number_format($this->tem,2,',','.');
  65. else return $this->tem;
  66. }
  67. public function getAfoact($val=false)
  68. {
  69. if($val) return number_format($this->afoact,2,',','.');
  70. else return $this->afoact;
  71. }
  72. public function getAnoact()
  73. {
  74. return trim($this->anoact);
  75. }
  76. public function getId()
  77. {
  78. return $this->id;
  79. }
  80. public function setCodact($v)
  81. {
  82. if ($this->codact !== $v) {
  83. $this->codact = $v;
  84. $this->modifiedColumns[] = FcactcomHcPeer::CODACT;
  85. }
  86. }
  87. public function setDesact($v)
  88. {
  89. if ($this->desact !== $v) {
  90. $this->desact = $v;
  91. $this->modifiedColumns[] = FcactcomHcPeer::DESACT;
  92. }
  93. }
  94. public function setMintri($v)
  95. {
  96. if ($this->mintri !== $v) {
  97. $this->mintri = Herramientas::toFloat($v);
  98. $this->modifiedColumns[] = FcactcomHcPeer::MINTRI;
  99. }
  100. }
  101. public function setExoner($v)
  102. {
  103. if ($this->exoner !== $v) {
  104. $this->exoner = $v;
  105. $this->modifiedColumns[] = FcactcomHcPeer::EXONER;
  106. }
  107. }
  108. public function setMinofac($v)
  109. {
  110. if ($this->minofac !== $v) {
  111. $this->minofac = $v;
  112. $this->modifiedColumns[] = FcactcomHcPeer::MINOFAC;
  113. }
  114. }
  115. public function setTipali($v)
  116. {
  117. if ($this->tipali !== $v) {
  118. $this->tipali = $v;
  119. $this->modifiedColumns[] = FcactcomHcPeer::TIPALI;
  120. }
  121. }
  122. public function setPorreb($v)
  123. {
  124. if ($this->porreb !== $v) {
  125. $this->porreb = Herramientas::toFloat($v);
  126. $this->modifiedColumns[] = FcactcomHcPeer::PORREB;
  127. }
  128. }
  129. public function setExepto($v)
  130. {
  131. if ($this->exepto !== $v) {
  132. $this->exepto = $v;
  133. $this->modifiedColumns[] = FcactcomHcPeer::EXEPTO;
  134. }
  135. }
  136. public function setRebaja($v)
  137. {
  138. if ($this->rebaja !== $v) {
  139. $this->rebaja = $v;
  140. $this->modifiedColumns[] = FcactcomHcPeer::REBAJA;
  141. }
  142. }
  143. public function setExento($v)
  144. {
  145. if ($this->exento !== $v) {
  146. $this->exento = $v;
  147. $this->modifiedColumns[] = FcactcomHcPeer::EXENTO;
  148. }
  149. }
  150. public function setTem($v)
  151. {
  152. if ($this->tem !== $v) {
  153. $this->tem = Herramientas::toFloat($v);
  154. $this->modifiedColumns[] = FcactcomHcPeer::TEM;
  155. }
  156. }
  157. public function setAfoact($v)
  158. {
  159. if ($this->afoact !== $v) {
  160. $this->afoact = Herramientas::toFloat($v);
  161. $this->modifiedColumns[] = FcactcomHcPeer::AFOACT;
  162. }
  163. }
  164. public function setAnoact($v)
  165. {
  166. if ($this->anoact !== $v) {
  167. $this->anoact = $v;
  168. $this->modifiedColumns[] = FcactcomHcPeer::ANOACT;
  169. }
  170. }
  171. public function setId($v)
  172. {
  173. if ($this->id !== $v) {
  174. $this->id = $v;
  175. $this->modifiedColumns[] = FcactcomHcPeer::ID;
  176. }
  177. }
  178. public function hydrate(ResultSet $rs, $startcol = 1)
  179. {
  180. try {
  181. $this->codact = $rs->getString($startcol + 0);
  182. $this->desact = $rs->getString($startcol + 1);
  183. $this->mintri = $rs->getFloat($startcol + 2);
  184. $this->exoner = $rs->getString($startcol + 3);
  185. $this->minofac = $rs->getString($startcol + 4);
  186. $this->tipali = $rs->getString($startcol + 5);
  187. $this->porreb = $rs->getFloat($startcol + 6);
  188. $this->exepto = $rs->getString($startcol + 7);
  189. $this->rebaja = $rs->getString($startcol + 8);
  190. $this->exento = $rs->getString($startcol + 9);
  191. $this->tem = $rs->getFloat($startcol + 10);
  192. $this->afoact = $rs->getFloat($startcol + 11);
  193. $this->anoact = $rs->getString($startcol + 12);
  194. $this->id = $rs->getInt($startcol + 13);
  195. $this->resetModified();
  196. $this->setNew(false);
  197. $this->afterHydrate();
  198. return $startcol + 14;
  199. } catch (Exception $e) {
  200. throw new PropelException("Error populating FcactcomHc object", $e);
  201. }
  202. }
  203. protected function afterHydrate()
  204. {
  205. }
  206. public function __call($m, $a)
  207. {
  208. $prefijo = substr($m,0,3);
  209. $metodo = strtolower(substr($m,3));
  210. if($prefijo=='get'){
  211. if(isset($this->$metodo)) return $this->$metodo;
  212. else return '';
  213. }elseif($prefijo=='set'){
  214. if(isset($this->$metodo)) $this->$metodo = $a[0];
  215. }else call_user_func_array($m, $a);
  216. }
  217. public function delete($con = null)
  218. {
  219. if ($this->isDeleted()) {
  220. throw new PropelException("This object has already been deleted.");
  221. }
  222. if ($con === null) {
  223. $con = Propel::getConnection(FcactcomHcPeer::DATABASE_NAME);
  224. }
  225. try {
  226. $con->begin();
  227. FcactcomHcPeer::doDelete($this, $con);
  228. $this->setDeleted(true);
  229. $con->commit();
  230. } catch (PropelException $e) {
  231. $con->rollback();
  232. throw $e;
  233. }
  234. }
  235. public function save($con = null)
  236. {
  237. if ($this->isDeleted()) {
  238. throw new PropelException("You cannot save an object that has been deleted.");
  239. }
  240. if ($con === null) {
  241. $con = Propel::getConnection(FcactcomHcPeer::DATABASE_NAME);
  242. }
  243. try {
  244. $con->begin();
  245. $affectedRows = $this->doSave($con);
  246. $con->commit();
  247. return $affectedRows;
  248. } catch (PropelException $e) {
  249. $con->rollback();
  250. throw $e;
  251. }
  252. }
  253. protected function doSave($con)
  254. {
  255. $affectedRows = 0; if (!$this->alreadyInSave) {
  256. $this->alreadyInSave = true;
  257. if ($this->isModified()) {
  258. if ($this->isNew()) {
  259. $pk = FcactcomHcPeer::doInsert($this, $con);
  260. $affectedRows += 1;
  261. $this->setId($pk);
  262. $this->setNew(false);
  263. } else {
  264. $affectedRows += FcactcomHcPeer::doUpdate($this, $con);
  265. }
  266. $this->resetModified(); }
  267. $this->alreadyInSave = false;
  268. }
  269. return $affectedRows;
  270. }
  271. protected $validationFailures = array();
  272. public function getValidationFailures()
  273. {
  274. return $this->validationFailures;
  275. }
  276. public function validate($columns = null)
  277. {
  278. $res = $this->doValidate($columns);
  279. if ($res === true) {
  280. $this->validationFailures = array();
  281. return true;
  282. } else {
  283. $this->validationFailures = $res;
  284. return false;
  285. }
  286. }
  287. protected function doValidate($columns = null)
  288. {
  289. if (!$this->alreadyInValidation) {
  290. $this->alreadyInValidation = true;
  291. $retval = null;
  292. $failureMap = array();
  293. if (($retval = FcactcomHcPeer::doValidate($this, $columns)) !== true) {
  294. $failureMap = array_merge($failureMap, $retval);
  295. }
  296. $this->alreadyInValidation = false;
  297. }
  298. return (!empty($failureMap) ? $failureMap : true);
  299. }
  300. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  301. {
  302. $pos = FcactcomHcPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  303. return $this->getByPosition($pos);
  304. }
  305. public function getByPosition($pos)
  306. {
  307. switch($pos) {
  308. case 0:
  309. return $this->getCodact();
  310. break;
  311. case 1:
  312. return $this->getDesact();
  313. break;
  314. case 2:
  315. return $this->getMintri();
  316. break;
  317. case 3:
  318. return $this->getExoner();
  319. break;
  320. case 4:
  321. return $this->getMinofac();
  322. break;
  323. case 5:
  324. return $this->getTipali();
  325. break;
  326. case 6:
  327. return $this->getPorreb();
  328. break;
  329. case 7:
  330. return $this->getExepto();
  331. break;
  332. case 8:
  333. return $this->getRebaja();
  334. break;
  335. case 9:
  336. return $this->getExento();
  337. break;
  338. case 10:
  339. return $this->getTem();
  340. break;
  341. case 11:
  342. return $this->getAfoact();
  343. break;
  344. case 12:
  345. return $this->getAnoact();
  346. break;
  347. case 13:
  348. return $this->getId();
  349. break;
  350. default:
  351. return null;
  352. break;
  353. } }
  354. public function toArray($keyType = BasePeer::TYPE_PHPNAME)
  355. {
  356. $keys = FcactcomHcPeer::getFieldNames($keyType);
  357. $result = array(
  358. $keys[0] => $this->getCodact(),
  359. $keys[1] => $this->getDesact(),
  360. $keys[2] => $this->getMintri(),
  361. $keys[3] => $this->getExoner(),
  362. $keys[4] => $this->getMinofac(),
  363. $keys[5] => $this->getTipali(),
  364. $keys[6] => $this->getPorreb(),
  365. $keys[7] => $this->getExepto(),
  366. $keys[8] => $this->getRebaja(),
  367. $keys[9] => $this->getExento(),
  368. $keys[10] => $this->getTem(),
  369. $keys[11] => $this->getAfoact(),
  370. $keys[12] => $this->getAnoact(),
  371. $keys[13] => $this->getId(),
  372. );
  373. return $result;
  374. }
  375. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  376. {
  377. $pos = FcactcomHcPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  378. return $this->setByPosition($pos, $value);
  379. }
  380. public function setByPosition($pos, $value)
  381. {
  382. switch($pos) {
  383. case 0:
  384. $this->setCodact($value);
  385. break;
  386. case 1:
  387. $this->setDesact($value);
  388. break;
  389. case 2:
  390. $this->setMintri($value);
  391. break;
  392. case 3:
  393. $this->setExoner($value);
  394. break;
  395. case 4:
  396. $this->setMinofac($value);
  397. break;
  398. case 5:
  399. $this->setTipali($value);
  400. break;
  401. case 6:
  402. $this->setPorreb($value);
  403. break;
  404. case 7:
  405. $this->setExepto($value);
  406. break;
  407. case 8:
  408. $this->setRebaja($value);
  409. break;
  410. case 9:
  411. $this->setExento($value);
  412. break;
  413. case 10:
  414. $this->setTem($value);
  415. break;
  416. case 11:
  417. $this->setAfoact($value);
  418. break;
  419. case 12:
  420. $this->setAnoact($value);
  421. break;
  422. case 13:
  423. $this->setId($value);
  424. break;
  425. } }
  426. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  427. {
  428. $keys = FcactcomHcPeer::getFieldNames($keyType);
  429. if (array_key_exists($keys[0], $arr)) $this->setCodact($arr[$keys[0]]);
  430. if (array_key_exists($keys[1], $arr)) $this->setDesact($arr[$keys[1]]);
  431. if (array_key_exists($keys[2], $arr)) $this->setMintri($arr[$keys[2]]);
  432. if (array_key_exists($keys[3], $arr)) $this->setExoner($arr[$keys[3]]);
  433. if (array_key_exists($keys[4], $arr)) $this->setMinofac($arr[$keys[4]]);
  434. if (array_key_exists($keys[5], $arr)) $this->setTipali($arr[$keys[5]]);
  435. if (array_key_exists($keys[6], $arr)) $this->setPorreb($arr[$keys[6]]);
  436. if (array_key_exists($keys[7], $arr)) $this->setExepto($arr[$keys[7]]);
  437. if (array_key_exists($keys[8], $arr)) $this->setRebaja($arr[$keys[8]]);
  438. if (array_key_exists($keys[9], $arr)) $this->setExento($arr[$keys[9]]);
  439. if (array_key_exists($keys[10], $arr)) $this->setTem($arr[$keys[10]]);
  440. if (array_key_exists($keys[11], $arr)) $this->setAfoact($arr[$keys[11]]);
  441. if (array_key_exists($keys[12], $arr)) $this->setAnoact($arr[$keys[12]]);
  442. if (array_key_exists($keys[13], $arr)) $this->setId($arr[$keys[13]]);
  443. }
  444. public function buildCriteria()
  445. {
  446. $criteria = new Criteria(FcactcomHcPeer::DATABASE_NAME);
  447. if ($this->isColumnModified(FcactcomHcPeer::CODACT)) $criteria->add(FcactcomHcPeer::CODACT, $this->codact);
  448. if ($this->isColumnModified(FcactcomHcPeer::DESACT)) $criteria->add(FcactcomHcPeer::DESACT, $this->desact);
  449. if ($this->isColumnModified(FcactcomHcPeer::MINTRI)) $criteria->add(FcactcomHcPeer::MINTRI, $this->mintri);
  450. if ($this->isColumnModified(FcactcomHcPeer::EXONER)) $criteria->add(FcactcomHcPeer::EXONER, $this->exoner);
  451. if ($this->isColumnModified(FcactcomHcPeer::MINOFAC)) $criteria->add(FcactcomHcPeer::MINOFAC, $this->minofac);
  452. if ($this->isColumnModified(FcactcomHcPeer::TIPALI)) $criteria->add(FcactcomHcPeer::TIPALI, $this->tipali);
  453. if ($this->isColumnModified(FcactcomHcPeer::PORREB)) $criteria->add(FcactcomHcPeer::PORREB, $this->porreb);
  454. if ($this->isColumnModified(FcactcomHcPeer::EXEPTO)) $criteria->add(FcactcomHcPeer::EXEPTO, $this->exepto);
  455. if ($this->isColumnModified(FcactcomHcPeer::REBAJA)) $criteria->add(FcactcomHcPeer::REBAJA, $this->rebaja);
  456. if ($this->isColumnModified(FcactcomHcPeer::EXENTO)) $criteria->add(FcactcomHcPeer::EXENTO, $this->exento);
  457. if ($this->isColumnModified(FcactcomHcPeer::TEM)) $criteria->add(FcactcomHcPeer::TEM, $this->tem);
  458. if ($this->isColumnModified(FcactcomHcPeer::AFOACT)) $criteria->add(FcactcomHcPeer::AFOACT, $this->afoact);
  459. if ($this->isColumnModified(FcactcomHcPeer::ANOACT)) $criteria->add(FcactcomHcPeer::ANOACT, $this->anoact);
  460. if ($this->isColumnModified(FcactcomHcPeer::ID)) $criteria->add(FcactcomHcPeer::ID, $this->id);
  461. return $criteria;
  462. }
  463. public function buildPkeyCriteria()
  464. {
  465. $criteria = new Criteria(FcactcomHcPeer::DATABASE_NAME);
  466. $criteria->add(FcactcomHcPeer::ID, $this->id);
  467. return $criteria;
  468. }
  469. public function getPrimaryKey()
  470. {
  471. return $this->getId();
  472. }
  473. public function setPrimaryKey($key)
  474. {
  475. $this->setId($key);
  476. }
  477. public function copyInto($copyObj, $deepCopy = false)
  478. {
  479. $copyObj->setCodact($this->codact);
  480. $copyObj->setDesact($this->desact);
  481. $copyObj->setMintri($this->mintri);
  482. $copyObj->setExoner($this->exoner);
  483. $copyObj->setMinofac($this->minofac);
  484. $copyObj->setTipali($this->tipali);
  485. $copyObj->setPorreb($this->porreb);
  486. $copyObj->setExepto($this->exepto);
  487. $copyObj->setRebaja($this->rebaja);
  488. $copyObj->setExento($this->exento);
  489. $copyObj->setTem($this->tem);
  490. $copyObj->setAfoact($this->afoact);
  491. $copyObj->setAnoact($this->anoact);
  492. $copyObj->setNew(true);
  493. $copyObj->setId(NULL);
  494. }
  495. public function copy($deepCopy = false)
  496. {
  497. $clazz = get_class($this);
  498. $copyObj = new $clazz();
  499. $this->copyInto($copyObj, $deepCopy);
  500. return $copyObj;
  501. }
  502. public function getPeer()
  503. {
  504. if (self::$peer === null) {
  505. self::$peer = new FcactcomHcPeer();
  506. }
  507. return self::$peer;
  508. }
  509. }