Skip to content

Instantly share code, notes, and snippets.

@walesmd
Created January 31, 2009 09:56
Show Gist options
  • Save walesmd/55501 to your computer and use it in GitHub Desktop.
Save walesmd/55501 to your computer and use it in GitHub Desktop.
<?php
class User extends Model {
function User() {
parent::Model();
}
function get($username = FALSE) {
if ($username !== FALSE) {
$username = (str) $username;
$query = $this->db->get('users', array('username' => $username), 1, 0);
if ($query->num_rows() === 1) {
return $query->row();
}
}
return FALSE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment