Skip to content

Instantly share code, notes, and snippets.

@cobyl
Created July 16, 2013 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cobyl/6010714 to your computer and use it in GitHub Desktop.
Save cobyl/6010714 to your computer and use it in GitHub Desktop.
i jeszcze dodatkowe przykłady
<?php
$this->tablegateway->select(function (\Zend\Db\Sql\Select $select) use ($params){
// kolumna created = updated
$select->where->equalTo('id','created');
// i pole like zawiera cos tam szukanego
$select->where->AND->like('name',"%".$params['search']."%");
// i pole email jest test@test.pl albo z domeny @test.com
$select->where->AND->NEST->equalTo('email','test@test.pl')->OR->like('email','%@test.com');
// a do tego jeszcze parametr email malymi literkami równa ... itd
$select->where->addPredicate(new \Zend\Db\Sql\Predicate\Expression("LOWER(email) = ?",$params['email']));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment