id_user.'" '); } public function projects() { } public function password($password) { } public static function facebook($id) { return self::q(' select user.* from user left join user_auth using(id_user) where user_auth.auth="'.Cana::db()->escape($id).'" and user_auth.`type`="facebook" and user.active=1 and user_auth.active=1 '); } public function defaults() { return Restaurant_DefaultOrder::q(' select * from restaurant_default_order where id_user="'.$this->id_user.'" '); } public function exports() { $out = $this->properties(); foreach ($this->defaults() as $default) { $out['defaults'][$default->id_restaurant] = $default->exports(); } return $out; } public function __construct($id = null) { parent::__construct(); $this ->table('user') ->idVar('id_user') ->load($id); } }