Changeset 13064
- Timestamp:
- 11/17/08 16:14:38 (5 years ago)
- Files:
-
- plugins/DbFinderPlugin/README (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/DbFinderPlugin/README
r13063 r13064 76 76 $articleFinder = DbFinder::from('Article'); 77 77 // Finding all Articles where title = 'foo' 78 $articles = $articleFinder->where('Title', 'foo')->find(); 78 $articles = $articleFinder-> 79 where('Title', 'foo')-> 80 find(); 79 81 // Finding all Articles where title like 'foo%' 80 $articles = $articleFinder->where('Title', 'like', 'foo%')->find(); 82 $articles = $articleFinder-> 83 where('Title', 'like', 'foo%')-> 84 find(); 81 85 // Finding all Articles where published_at less than time() 82 $articles = $articleFinder->where('PublishedAt', '<', time())->find(); 86 $articles = $articleFinder-> 87 where('PublishedAt', '<', time())-> 88 find(); 89 // Finding all Articles with no category 90 $articles = $articleFinder-> 91 where('CategoryId', 'is not null', null)-> 92 find(); 83 93 84 94 // You can chain WHERE clauses … … 95 105 96 106 // The where() method accepts simple or composed column names ('ClassName.ColumnName') 97 $articles = $articleFinder->where('Article.Title', 'foo')->find(); 107 $articles = $articleFinder-> 108 where('Article.Title', 'foo')-> 109 find(); 98 110 // You can also use the magic whereXXX() method, removing the column argument and concatenating it to the method name 99 $articles = $articleFinder->whereTitle('foo')->find(); 111 $articles = $articleFinder-> 112 whereTitle('foo')-> 113 find(); 100 114 // Or, when your search is on a single column, use the magic findByXXX() method 101 115 $articles = $articleFinder->findByTitle('foo');