I'm trying to use the "not like" operator in cakephp, if I use this:
$users = $this->find('all', array(
'fields' => array(
'User.id', 'User.first_name',
'User.last_name', 'User.country',
'User.division', 'User.department',
'User.function'),
'recursive' => -1,
'order' => array('User.first_name ASC'),
'conditions' => array(
'User.active' => true,
'User.company' => $comp,
'User.country' => $country,
'User.division' => $division,
'User.department' => $dpto,
'NOT' => array(
'User.function LIKE' => 'COORD%'
)
)
));
The code works, however, if I try to put two same fields instead of one with different values like this:
'NOT' => array(
'User.function LIKE' => 'COORD%',
'User.function LIKE' => 'MANAG%'
)
It doesn't work, what am I doing wrong?
EDIT
I already fixed it that day like this:
'NOT' => array(
'User.function LIKE' => 'COORD%','User.function LIKE "MANAG%"'
)
I hope this is useful for someone.