Skip to content

Instantly share code, notes, and snippets.

@jamband
jamband / sample.php
Last active January 15, 2026 10:23
Yii Framework: example LIKE query.
<?php
$c = new CDbCriteria();
Hoge::model()->findAll($c);
// SELECT * FROM `hoge` `t`
$c = new CDbCriteria();
$c->addSearchCondition('t.fuga', null); // null, false, ''などは無視されるようです
Hoge::model()->findAll($c);