Last active
December 14, 2015 08:09
-
-
Save magefad/5055908 to your computer and use it in GitHub Desktop.
Yii мульти-табличный CActiveRecord / multitable CActiveRecord
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ActiveRecord extends CActiveRecord | |
{ | |
private static $_tableName; | |
public static function instance($tableName) | |
{ | |
self::$_tableName=$tableName; | |
return parent::model(__CLASS__); | |
} | |
public function tableName() | |
{ | |
return self::$_tableName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using