Advertisement
Guest User

Untitled

a guest
Jan 6th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.4
  8. * @ Author : DeZender
  9. * @ Release on : 21.10.2015
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Ppb\Service\Table {
  15.  
  16. abstract class AbstractServiceTable extends Ppb\Service\AbstractService {
  17.  
  18. protected $_insertRows = 1;
  19. protected $_mainColumn = null;
  20. /**
  21. *
  22. * get number of insert rows
  23. *
  24. * @return integer
  25. */
  26. public function getInsertRows() {
  27.  
  28. return $this->_insertRows;
  29. }
  30.  
  31. public function getMainColumn($columns) {
  32.  
  33. return $this->_mainColumn ? ($this->_mainColumn) : ($columns[0]);
  34. }
  35.  
  36. /**
  37. *
  38. * set number of insert rows
  39. *
  40. * @param integer $insertRows
  41. * @return \Ppb\Service\Table\AbstractServiceTable
  42. */
  43. public function setInsertRows($insertRows) {
  44.  
  45. $this->_insertRows = (int)$insertRows;
  46. return $this;
  47. }
  48.  
  49. /**
  50. *
  51. * save data in the table (update if an id exists or insert otherwise)
  52. *
  53. * TODO: PROBLEM WITH "max_input_vars" php setting for big arrays of data
  54. *
  55. * @param array $data
  56. * @return \Ppb\Service\Table\AbstractServiceTable
  57. * @throws \InvalidArgumentException
  58. */
  59. public function save($data) {
  60.  
  61. if (!isset($data["id"]))
  62. {
  63. throw new InvalidArgumentException("The form must use an element with the name 'id'.");
  64. .....................................................................
  65. .......................................
  66. ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement