Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include '/Users/ralphschindler/Projects/zf2/vendor/autoload.php';
- use Zend\Db\Sql\Select;
- use Zend\Db\Sql\Predicate;
- $select = new Select;
- $select->from('foo');
- $select->where(['x' => null]);
- $select->where(['x' => 5], 'OR');
- // OR
- $select->where(function ($where) {
- $where->isNull('x')->OR->equalTo('x', 5);
- });
- $select->where(new Predicate\Expression('x IS NULL or x = ?', 5));
- echo @$select->getSqlString();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement