Source

myswap / 1 / code / App / Lib / Model / UserModel.class.php

Full commit
<?php
class UserModel extends Model{
	protected $fields = array(
	'user_id', 
	'username', 
	'email', 
	'password',
	'friends',
	// 'public_state',
	'_pk'=>'user_id',
	'_autoinc'=>true
	);
	public function getById($user_id)
	{
	return  $this->query("select * from __TABLE__ where user_id='$user_id'");
	}
	public function getByUsername($username)
	{
	$username=strtolower($username);
	return  $this->query("select * from __TABLE__ where username='$username'");
	}
}
?>