meier_flo
meier_flo

Reputation: 136

Propel: PHP Fatal error: Class 'Criteria' not found

I'm trying to do a filterBy query in Propel with Criteria::XXXX as a second argument. Like the example in the documentation:

$books = BookQuery::create()
  ->filterByTags(array('novel', 'russian'), Criteria::CONTAINS_ALL)
  ->find();

But this always fails giving me the error that the Class Criteria is not found.

Otherwise Propel works just fine. Anybody an idea how this could be fixed?

Upvotes: 1

Views: 1451

Answers (2)

hugsbrugs
hugsbrugs

Reputation: 3621

For Propel 2 :

require_once __DIR__ . '/path_to/autoload.php';
use Propel\Runtime\ActiveQuery\Criteria;

Upvotes: 0

Matheno
Matheno

Reputation: 4152

You forgot to include the class '\Propel\Runtime\Query\Criteria'

Upvotes: 2

Related Questions