Skip to content
Implementation of Yii's CActiveRecord that allows specifying DB table name
PHP
Find file
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.md README fix Aug 7, 2012

README.md

Yii-dynamic-active-record

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

Usage

(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';
$userModel->save();
Something went wrong with that request. Please try again.