Skip to content

Instantly share code, notes, and snippets.

@patrickmaciel
Created December 27, 2011 17:23
Show Gist options
  • Save patrickmaciel/1524448 to your computer and use it in GitHub Desktop.
Save patrickmaciel/1524448 to your computer and use it in GitHub Desktop.
Remove Group Null
<?php
# find
$gerentes = $this->User->find('all', array(
'contain' => array(
'Group' => array(
'conditions' => array(
'Group.id' => 4
)
)
)
)
);
# return of array
# ...
[5] => Array
(
[User] => Array
(
[id] => 5037
[seller] => 6
[name] => Chinelo
[last_name] => Rodrigo
[another_phone] =>
[fax] =>
[cell] => 3488321123
[phone] => 3432119900
[email_address] => rodrigochinelo@gmail.com
[another_email] => chinelzinho@hotmail.com
[birth_date] => 2011-12-26 17:16:00
[password] => 4e728195ac664fe24ca944e3576733eb
[access] =>
[last_access] =>
[created] => 2011-12-26 17:16:31
[modified] => 2011-12-27 10:23:53
[active] => 1
[who_create] =>
[updated] => 2011-12-27 10:23:53
[user_id] => 0
)
[Group] => Array
(
)
)
[6] => Array
(
[User] => Array
(
[id] => 5036
[seller] => 5
[name] => Maria
[last_name] => Neuza
[another_phone] =>
[fax] =>
[cell] => 3488321123
[phone] => 3432119900
[email_address] => marianeuza@gmail.com
[another_email] => neuzinha@hotmail.com
[birth_date] => 2011-12-26 17:15:00
[password] => c798c10fd6034ab4c825332d70271e60
[access] =>
[last_access] =>
[created] => 2011-12-26 17:15:55
[modified] => 2011-12-26 17:15:55
[active] => 1
[who_create] =>
[updated] => 2011-12-26 17:15:55
[user_id] => 0
)
[Group] => Array
(
[0] => Array
(
[id] => 4
[name] => Gerente
[created] => 2011-09-20 05:46:08
[modified] => 2011-09-20 05:46:08
[active] => 1
[who_create] =>
[GroupsUser] => Array
(
[group_id] => 4
[user_id] => 5036
[created] => 0000-00-00 00:00:00
[modified] =>
[active] => 1
[who_create] =>
[id] => 57
)
)
)
)
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment