I'm trying CLI coding. I just tried to get all Users, want to load them and list data or do some actions.
<?php
require_once 'abstract.php';
class Shell_List extends Mage_Shell_Abstract {
public function run() {
$users = Mage::getModel('customer/customer') -> getCollection() -> getData();
foreach ($users as $u) {
$user = mage::getModel('customer/customer') -> loadByEmail($email = $u['email']);
echo $email, ' ', $user -> getName(), "\n";
}
}
}
$shell = new Shell_List();
$shell -> run();
Well, the loadByEmail() methods throws an exception with the message
Customer website ID must be specified when using the website scope
That's logical, a user identified email can exist in more websites. How do I set the website, and maybe, list all users of the website?