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

  1. Usage
  2. Download

This class allows accessing DB tables in an AR-like fashion, without the need to create a class for each table.

Usage

Copy class to your project (eg to protected/components). Create a new instance by specifying table name:

$userModel = DynamicActiveRecord::forTable('user');

And then use it like any other AR class:

//list existing users
foreach ($userModel->findAll() as $user)
	echo $user->id . ': ' . $user->name . '<br>';
//add new user
$userModel->name = 'Pavle Predic';
$userModel->save();

Download

https://github.com/pavlepredic/Yii-dynamic-active-record</a>

2 0
12 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Database
Developed by: pavlepredic
Created on: Aug 7, 2012
Last updated: 11 years ago

Related Extensions