Created
December 11, 2009 10:53
-
-
Save fzaninotto/254133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// syntax 1: condition/combine | |
$books = PropelQuery::from('Book') | |
->condition('cond1', 'Book.Title = ?', 'War And Peace') // create a condition named 'cond1' | |
->condition('cond2', 'Book.Title LIKE ?', 'War%') // create a condition named 'cond2' | |
->combine(array('cond1', 'cond2'), 'or', 'cond12') // create a condition named 'cond12' from 'cond1' and 'cond2' | |
->condition('cond3', 'Book.PublishedAt <= ?', $end) // create a condition named 'cond3' | |
->condition('cond4', 'Book.PublishedAt >= ?', $begin) // create a condition named 'cond4' | |
->combine(array('cond3', 'cond4'), 'and', 'cond34') // create a condition named 'cond34' from 'cond3' and 'cond4' | |
->where(array('cond12', 'cond34'), 'and') // combine the two conditions in a where | |
->find(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment