I need to run a concatenated OR LIKE query type, however with Yii2 this is not returning results where a record contains a NULL value.
E.g.
table = project
id = 1, author_name = Martin, owner_name = NULL
id = 2, author_name = Steve, owner_name = Martin
$criterion['author_name']= ['like','author_name','%'.mart.'%', false];
$criterion['owner_name']= ['like','owner_name','%'.mart.'%', false];
$dataProvider = new ActiveDataProvider([
'query' => Project::findBy()->where(['or', $criterion])->select(['id']),
]);
This only returns the record id #2 and not record id #1
The same thing happens if I write the query myself
$dataProvider = Project::findBySql('SELECT id FROM project WHERE author_name LIKE "%mart%" OR owner_name LIKE "%mart%"')->all();
If I execute this exact same query directly in MySQL prompt I get all results as expected
Any ideas?