Persistent.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * This file is part of the Propel package.
  4. * For the full copyright and license information, please view the LICENSE
  5. * file that was distributed with this source code.
  6. *
  7. * @license MIT License
  8. */
  9. /**
  10. * This interface defines methods related to saving an object
  11. *
  12. * @author Hans Lellelid <hans@xmpl.org> (Propel)
  13. * @author John D. McNally <jmcnally@collab.net> (Torque)
  14. * @author Fedor K. <fedor@apache.org> (Torque)
  15. * @version $Revision: 1612 $
  16. * @package propel.runtime.om
  17. */
  18. interface Persistent
  19. {
  20. /**
  21. * getter for the object primaryKey.
  22. *
  23. * @return ObjectKey the object primaryKey as an Object
  24. */
  25. public function getPrimaryKey();
  26. /**
  27. * Sets the PrimaryKey for the object.
  28. *
  29. * @param mixed $primaryKey The new PrimaryKey object or string (result of PrimaryKey.toString()).
  30. * @return void
  31. * @throws Exception, This method might throw an exceptions
  32. */
  33. public function setPrimaryKey($primaryKey);
  34. /**
  35. * Returns whether the object has been modified, since it was
  36. * last retrieved from storage.
  37. *
  38. * @return boolean True if the object has been modified.
  39. */
  40. public function isModified();
  41. /**
  42. * Has specified column been modified?
  43. *
  44. * @param string $col
  45. * @return boolean True if $col has been modified.
  46. */
  47. public function isColumnModified($col);
  48. /**
  49. * Returns whether the object has ever been saved. This will
  50. * be false, if the object was retrieved from storage or was created
  51. * and then saved.
  52. *
  53. * @return boolean True, if the object has never been persisted.
  54. */
  55. public function isNew();
  56. /**
  57. * Setter for the isNew attribute. This method will be called
  58. * by Propel-generated children and Peers.
  59. *
  60. * @param boolean $b the state of the object.
  61. */
  62. public function setNew($b);
  63. /**
  64. * Resets (to false) the "modified" state for this object.
  65. *
  66. * @return void
  67. */
  68. public function resetModified();
  69. /**
  70. * Whether this object has been deleted.
  71. * @return boolean The deleted state of this object.
  72. */
  73. public function isDeleted();
  74. /**
  75. * Specify whether this object has been deleted.
  76. * @param boolean $b The deleted state of this object.
  77. * @return void
  78. */
  79. public function setDeleted($b);
  80. /**
  81. * Deletes the object.
  82. * @param PropelPDO $con
  83. * @return void
  84. * @throws Exception
  85. */
  86. public function delete(PropelPDO $con = null);
  87. /**
  88. * Saves the object.
  89. * @param PropelPDO $con
  90. * @return void
  91. * @throws Exception
  92. */
  93. public function save(PropelPDO $con = null);
  94. }