コード例 #1
0
	/**
	 * Sets the default manager
	 *
	 * @param Atomik_Model_Manager $db
	 */
	public static function setDefault(Atomik_Model_Manager $manager = null)
	{
		if ($manager === null) {
			$manager = new self(Atomik_Db::getInstance());
		}
		self::$_default = $manager;
	}
コード例 #2
0
	public static function create(Atomik_Db_Instance $instance = null)
	{
		if ($instance === null) {
			$instance = Atomik_Db::getInstance();
		}
		return new self($instance);
	}
コード例 #3
0
ファイル: Plugin.php プロジェクト: neronen/tsoha-k11p4-atomik
	/**
	 * Executes sql scripts for models and the ones located in the sql folder.
	 * Will look in the app folder as well as in each plugin folder.
	 * 
	 * @param 	string	$instance
	 * @param 	array	$filter
	 * @param	bool	$echo		Whether to echo or return the output from the script execution
	 * @return	string
	 */
	public static function dbCreate($instance = 'default', $filter = array(), $echo = false)
	{
		$script = self::getDbScript($filter, $echo);
		Atomik::fireEvent('Db::Create::Before', array(&$instance, $script));
		
		$script->run(Atomik_Db::getInstance($instance));
		
		Atomik::fireEvent('Db::Create::After', array($instance, $script));
		return $script->getOutputHandler()->getText();
	}