How can I look up a user by email? I thought that JTable::load
would do it, but it returns a weird data shape:
$user = JTable::getInstance('User', 'JTable', array());
$user->load(array("email" => "someemail@gmail.com"));
print_r(json_encode($user))
groups": null,
"id": {
"email": "someemail@gmail.com"
},
"name": "",
"username": "",
"email": "",
...
JTable::load
works like this for Categories, however.
$cat = JTable::getInstance('Category', 'JTable', array());
$cat->load(array("title" => "some title"));
Do I have to use JFactory::getDbo()
?