Skip to content

Instantly share code, notes, and snippets.

View modernserf's full-sized avatar

Justin Falcone modernserf

View GitHub Profile
@modernserf
modernserf / DietActiveRecord.php
Created July 6, 2013 05:02
very lightweight implementation of something that resembles Rails' implementation of ActiveRecord.
class DietActiveRecord {
public static function all( $select = null ){
$self = get_called_class();
$query = 'SELECT '. $self::select_string($select) .
' FROM '. $self::$table_name;
return $self::query($query, null, true);
}