ModelCode::init PHP Method

init() public method

public init ( )
    public function init()
    {
        if (Yii::app()->{$this->connectionId} === null) {
            throw new CHttpException(500, 'An active "db" connection is required to run this generator.');
        }
        $this->tablePrefix = Yii::app()->{$this->connectionId}->tablePrefix;
        parent::init();
    }

Usage Example

 public function init()
 {
     parent::init();
     if (!@class_exists("GtcSaveRelationsBehavior")) {
         throw new CException("Fatal Error: Class 'GtcSaveRelationsBehavior' could not be found in your application! Include the composer autoload.php or add it to your import paths.");
     }
 }
All Usage Examples Of ModelCode::init