Changeset 8102
- Timestamp:
- 03/27/08 00:52:47 (5 years ago)
- Files:
-
- plugins/sfPropelFinderPlugin/README (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfPropelFinderPlugin/README
r8101 r8102 74 74 $articles = $articleFinder->whereTitle('like', 'foo%')->find(); 75 75 // Finding all Articles where published_at less than time() 76 $articles = $articleFinder->wherePublishe At('<', time())->find();76 $articles = $articleFinder->wherePublishedAt('<', time())->find(); 77 77 }}} 78 78 … … 110 110 === Writing your own business logic into a finder === 111 111 112 You can create a new finder for your objects, with custom methods. The only prerequisites are to extend `sfPropelFinder` and to define a protected `$peerClass` property. Then, the object has acces to a protected `$criteria` proprty, whici is a Propel Criteria that can be augmented in the usual wqy. Don't forget to return the current object (`$this`) in the new methods.112 You can create a new finder for your objects, with custom methods. The only prerequisites are to extend `sfPropelFinder` and to define a protected `$peerClass` property. Then, the object has access to a protected `$criteria` property, which is a Propel Criteria that can be augmented in the usual way. Don't forget to return the current object (`$this`) in the new methods. 113 113 114 114 For instance, to add a `recent()` method to an article finder: … … 126 126 ArticlePeer::CREATED_AT, 127 127 time() - sfConfig::get('app_recent_days', 5) * 24 * 60 * 60, 128 Criteria::GREATER_THAN); 128 Criteria::GREATER_THAN 129 ); 129 130 return $this; 130 131 } … … 136 137 * Handle Joins 137 138 * Add more magic! 138 * Merge with sfPropelImpersonatorPlugin ?139 * Merge with sfPropelImpersonatorPlugin? 139 140 140 141 == Changelog ==