Changeset 8655
- Timestamp:
- 04/28/08 17:54:35 (5 years ago)
- Files:
-
- plugins/sfPropelNotificationPlugin/trunk/README (modified) (2 diffs)
- plugins/sfPropelNotificationPlugin/trunk/config/config.php (modified) (1 diff)
- plugins/sfPropelNotificationPlugin/trunk/config/schema.yml (added)
- plugins/sfPropelNotificationPlugin/trunk/lib/behavior/sfPropelNotificationBehavior.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelNotificationPlugin/trunk/README
r8654 r8655 46 46 #!php 47 47 <?php 48 $this->getUser()->setAttribute('uid', $id, 'sfPropelNotificationPlugin'); 49 $this->getUser()->setAttribute('peer_class', 'UserPeer', 'sfPropelNotificationPlugin'); 50 }}} 48 $user->setAttribute('uid', $id, 'sfPropelNotificationPlugin'); 49 $user->setAttribute('peer_class', 'UserPeer', 'sfPropelNotificationPlugin'); 50 }}} 51 52 === Update model === 53 54 * Enable behaviors in project's `propel.ini` 55 * Rebuild model : `propel-build-all` 51 56 52 57 == Usage == … … 268 273 === trunk === 269 274 275 ==== 2008-04-28 ==== 276 * added setBeforeSave() and getBeforeSave() methods to public API 277 * changed svn repository layout in order to enabled branched development 278 * fixed some documentation quirks 279 280 ==== Sometime before ==== 270 281 * removed hardcoded "User" model 271 282 * wrote installation docs plugins/sfPropelNotificationPlugin/trunk/config/config.php
r3560 r8655 19 19 'setWasNew' => array('sfPropelNotificationBehavior', 'setWasNew'), 20 20 'getWasNew' => array('sfPropelNotificationBehavior', 'getWasNew'), 21 'setBeforeSave' => array('sfPropelNotificationBehavior', 'setBeforeSave'), 22 'getBeforeSave' => array('sfPropelNotificationBehavior', 'getBeforeSave'), 21 23 )); plugins/sfPropelNotificationPlugin/trunk/lib/behavior/sfPropelNotificationBehavior.class.php
r3560 r8655 22 22 23 23 /** 24 * This hook to keep object "novelty" once it is saved. 24 * This hook to keep object "novelty" once it is saved. It also saves object's state before saving 25 * it to enable later comparisons. 25 26 * 26 27 * @param BaseObject $object … … 32 33 $object->setWasNew(true); 33 34 } 35 36 // Save object state prior to saving 37 $object->setBeforeSave($object); 34 38 } 35 39 … … 97 101 } 98 102 103 /** 104 * Saves object instance into "before_save" property. It can be called later (in notification 105 * logic provider for instance) with getBeforeSave(). Useful for before / after comparisons. 106 * 107 * @param BaseObject $object 108 */ 109 public function setBeforeSave(BaseObject $object) 110 { 111 $object->before_save = $object; 112 } 113 114 /** 115 * Returns object instance as it was when the preSave() hook was called. 116 * 117 * @return BaseObject $object 118 */ 119 public function getBeforeSave() 120 { 121 return $this->before_save; 122 } 123 99 124 }