Whitespace cleanup
This commit is contained in:
parent
79d9f45c38
commit
c1ba468807
@ -3,7 +3,7 @@ class User extends Entity {
|
|||||||
private $id = 0;
|
private $id = 0;
|
||||||
private $name = '';
|
private $name = '';
|
||||||
private $notes = '';
|
private $notes = '';
|
||||||
|
|
||||||
public static function create_user($name) {
|
public static function create_user($name) {
|
||||||
$ins_user = prepare('insert into `user`(`name`) values (?)');
|
$ins_user = prepare('insert into `user`(`name`) values (?)');
|
||||||
bind($ins_user, 's', $name);
|
bind($ins_user, 's', $name);
|
||||||
@ -34,7 +34,7 @@ class User extends Entity {
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$this->update_fields();
|
$this->update_fields();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function update_fields() {
|
private function update_fields() {
|
||||||
$get = prepare('select * from `user` where `id`=?');
|
$get = prepare('select * from `user` where `id`=?');
|
||||||
bind($get, 'i', $this->id);
|
bind($get, 'i', $this->id);
|
||||||
@ -125,11 +125,11 @@ class User extends Entity {
|
|||||||
public function get_id() {
|
public function get_id() {
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_name() {
|
public function get_name() {
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_name($newname) {
|
public function set_name($newname) {
|
||||||
$update = prepare('update `user` set `name`=? where `id`=?');
|
$update = prepare('update `user` set `name`=? where `id`=?');
|
||||||
bind($update, 'si', $newname, $this->id);
|
bind($update, 'si', $newname, $this->id);
|
||||||
@ -141,7 +141,7 @@ class User extends Entity {
|
|||||||
public function get_notes() {
|
public function get_notes() {
|
||||||
return $this->notes;
|
return $this->notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_notes($newnotes) {
|
public function set_notes($newnotes) {
|
||||||
$update = prepare('update `user` set `notes`=? where `id`=?');
|
$update = prepare('update `user` set `notes`=? where `id`=?');
|
||||||
bind($update, 'si', $newnotes, $this->id);
|
bind($update, 'si', $newnotes, $this->id);
|
||||||
@ -151,7 +151,7 @@ class User extends Entity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function get_loans($type = 'both') {
|
public function get_loans($type = 'both') {
|
||||||
$statement = "select `id` from `event`
|
$statement = "select `id` from `event`
|
||||||
left join `loan` on `event`.`id` = `loan`.`event`
|
left join `loan` on `event`.`id` = `loan`.`event`
|
||||||
where
|
where
|
||||||
`type`='loan' and `user`=?";
|
`type`='loan' and `user`=?";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user