Prado\Data\ActiveRecord\TActiveRecordManager::getInstance PHP Method

getInstance() public static method

public static getInstance ( $self = null ) : TActiveRecordManager
return TActiveRecordManager static instance of record manager.
    public static function getInstance($self = null)
    {
        static $instance;
        if ($self !== null) {
            $instance = $self;
        } else {
            if ($instance === null) {
                $instance = new self();
            }
        }
        return $instance;
    }

Usage Example

Example #1
0
 function __construct()
 {
     if (!class_exists("TActiveRecordManager", false)) {
         throw new Exception("You need to enable the ActiveRecord module in your application configuration file.");
     }
     $ar_manager = TActiveRecordManager::getInstance();
     $_conn = $ar_manager->getDbConnection();
     $_conn->Active = true;
     $this->_dbMetaData = TDbMetaData::getInstance($_conn);
 }
All Usage Examples Of Prado\Data\ActiveRecord\TActiveRecordManager::getInstance