Category Archives: doctrine2

Symfony2, DBAL, Doctrine2: create SQL IN Operator from PHP array

$aAccountCode = array(‘blabla1’, ‘accouncode1111’); $oDBALConnection = $this->get(‘database_connection’); $stmt = $oDBALConnection->executeQuery(‘SELECT * FROM table_name WHERE resource_name IN (?)’, array($aAccountCode), array(\Doctrine\DBAL\Connection::PARAM_STR_ARRAY) ); $stmt->execute(); $aAccountID = $stmt->fetchAll( \PDO::FETCH_COLUMN); Advertisements

Posted in array, DBAL, doctrine2, IN, Symfony2 | Leave a comment

jqgrid, Symfony2 – how we can process data from jqgrid searchbox

The jqgrid send filtered data in this format: ?_search=true&filters=&nd=1332250471208&page=1&rows=20&searchField=emailAddress&searchOper=eq&searchString=testmailaddress%40bibibi.com&sidx=id&sord=asc if we want to process we can use such method: $oQ0 = $repository->createQueryBuilder(‘p’) ->orderBy(‘p.fieldname’, ‘ASC’]); if ( ($tmp = $request->get(‘_search’)) && ($tmp == “true”) && $request->get(‘searchField’) ) { $searchField = $request->get(‘searchField’); … Continue reading

Posted in doctrine2, Expr* classes, Symfony2. jqgrid | Leave a comment