Skip to content

Instantly share code, notes, and snippets.

@patrickmaciel
Created December 27, 2011 19:31
Show Gist options
  • Save patrickmaciel/1524880 to your computer and use it in GitHub Desktop.
Save patrickmaciel/1524880 to your computer and use it in GitHub Desktop.
Find User by Groups (HABTM) Error
<?php
// não deu certo
$this->recursive = 1;
$this->bindModel(array('hasOne' => array('GroupsUser')));
return $this->find('list', array(
'contain' => array(
'GroupsUser' => array(
'conditions' => array('GroupsUser.group_id' => 4)
)
)
));
// não deu certo também
$this->recursive = 1;
$this->bindModel(array('hasOne' => array('GroupsUser')));
$gerentes = $this->find('list', array(
'contain' => array(
'GroupsUser'
),
'conditions' => array('GroupsUser.group_id' => 4)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment