Skip to content
Implementation of Yii's CActiveRecord that allows specifying DB table name
Latest commit 6c4cbca Aug 7, 2012 Pavle Predic README fix
Failed to load latest commit information.
DynamicActiveRecord.php Added AR class Aug 7, 2012 README fix Aug 7, 2012


CActiveRecord implementation that allows specifying DB table name instead of creating a class for each table.


(assuming table 'user' with columns 'id' and 'name'):

$userModel = DynamicActiveRecord::forTable('user');
//list existing users
foreach ($userModel->findAll() as $user)
    echo $user->id . ': ' . $user->name . '<br>';
//add new user
$userModel->name = 'Pavle Predic';
Something went wrong with that request. Please try again.