PageRenderTime 84ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/pdf/code/trunk/administrator/components/com_artofpdf/tables/pdf.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 126 lines | 38 code | 19 blank | 69 comment | 3 complexity | 64ea5fbf600eceb7e4ad9e95e379ebbb MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: pdf.php 288 2010-09-27 21:45:36Z eddieajau $
  4. * @package NewLifeInIT
  5. * @subpackage com_artofpdf
  6. * @copyright Copyright 2010 New Life in IT Pty Ltd. All rights reserved.
  7. * @license GNU General Public License version 2 or later.
  8. * @link http://www.theartofjoomla.com
  9. */
  10. // No direct access
  11. defined('_JEXEC') or die;
  12. /**
  13. * @package NewLifeInIT
  14. * @subpackage com_artofpdf
  15. * @since 1.0
  16. */
  17. class ArtofPdfTablePdf extends JTable
  18. {
  19. /**
  20. * @var int
  21. */
  22. public $id = null;
  23. /**
  24. * @var varchar
  25. */
  26. public $title = null;
  27. /**
  28. * @var varchar
  29. */
  30. public $subject = null;
  31. /**
  32. * @var varchar
  33. */
  34. public $keywords = null;
  35. /**
  36. * @var varchar
  37. */
  38. public $style = null;
  39. /**
  40. * @var varchar
  41. */
  42. public $data = null;
  43. /**
  44. * @var varchar
  45. */
  46. public $params = null;
  47. /**
  48. * @var int
  49. */
  50. public $published = null;
  51. /**
  52. * @var int
  53. */
  54. public $access = null;
  55. /**
  56. * @var datetime
  57. */
  58. public $build_time = null;
  59. /*
  60. * Constructor
  61. *
  62. * @param object Database object
  63. *
  64. * @return ArtofTablePdfs
  65. * @since 1.0
  66. */
  67. function __construct(&$db)
  68. {
  69. parent::__construct('#__artof_pdfs', 'id', $db);
  70. }
  71. /**
  72. * Binds a named array/hash to this object
  73. *
  74. * Can be overloaded/supplemented by the child class
  75. *
  76. * @param mixed $from An associative array or object
  77. * @param mixed $ignore An array or space separated list of fields not to bind
  78. *
  79. * @return boolean
  80. * @since 1.0
  81. */
  82. public function bind($from, $ignore = array())
  83. {
  84. if (!($result = parent::bind($from, $ignore))) {
  85. return $result;
  86. }
  87. if (is_array($this->params)) {
  88. $this->params = json_encode($this->params);
  89. }
  90. return $result;
  91. }
  92. /*
  93. * Check the internal data for of the object.
  94. *
  95. * @return boolean
  96. * @since 1.0
  97. */
  98. function check()
  99. {
  100. $this->title = trim($this->title);
  101. if (empty($this->title)) {
  102. $this->setError('COM_ARTOFPDF_ERROR_NO_TITLE');
  103. return false;
  104. }
  105. return true;
  106. }
  107. }