summaryrefslogtreecommitdiff
path: root/app/Models/Factory.php
blob: 93f4552f70ec2ba70ba0c9195cf2423b633e7132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

class FreshRSS_Factory {

	public static function createFeedDao($username = null) {
		$db = Minz_Configuration::dataBase();
		if ($db['type'] === 'sqlite') {
			return new FreshRSS_FeedDAOSQLite($username);
		} else {
			return new FreshRSS_FeedDAO($username);
		}
	}

	public static function createEntryDao($username = null) {
		$db = Minz_Configuration::dataBase();
		if ($db['type'] === 'sqlite') {
			return new FreshRSS_EntryDAOSQLite($username);
		} else {
			return new FreshRSS_EntryDAO($username);
		}
	}

	public static function createStatsDAO($username = null) {
		$db = Minz_Configuration::dataBase();
		if ($db['type'] === 'sqlite') {
			return new FreshRSS_StatsDAOSQLite($username);
		} else {
			return new FreshRSS_StatsDAO($username);
		}
	}

}