PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/model/om/BaseFcvalinmold.php

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