Skip to content

Instantly share code, notes, and snippets.

@ideesimple
Created December 27, 2010 13:39
Show Gist options
  • Save ideesimple/756137 to your computer and use it in GitHub Desktop.
Save ideesimple/756137 to your computer and use it in GitHub Desktop.
ex recherche dans une table
$criteria = $modx->newQuery('modResource');
$criteria->leftJoin('modUser','PublishedBy');
$criteria->where(array(
'modResource.published' => 1,
'modResource.searchable' => 1,
'pagetitle:LIKE' => $value.'%'
));
$criteria->orCondition(array(
'PublishedBy.username' => 'george123',
),null,1);
$criteria->sortby('menuindex','ASC');
$criteria->limit(10,20);
$Total = $modx->getCount('modResource',$criteria);
$resources = $modx->getCollection('modResource',$criteria);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment