Development

Changeset 13064

You must first sign up to be able to contribute.

Changeset 13064

Show
Ignore:
Timestamp:
11/17/08 16:14:38 (5 years ago)
Author:
francois
Message:

DbFinderPlugin Made the doc more explicit about is null and is not null syntax (closes #4763)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/DbFinderPlugin/README

    r13063 r13064  
    7676    $articleFinder = DbFinder::from('Article'); 
    7777    // Finding all Articles where title = 'foo' 
    78     $articles = $articleFinder->where('Title', 'foo')->find(); 
     78    $articles = $articleFinder-> 
     79      where('Title', 'foo')-> 
     80      find(); 
    7981    // 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(); 
    8185    // 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(); 
    8393 
    8494    // You can chain WHERE clauses 
     
    95105     
    96106    // 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(); 
    98110    // 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(); 
    100114    // Or, when your search is on a single column, use the magic findByXXX() method 
    101115    $articles = $articleFinder->findByTitle('foo');