forked from ushahidi/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCountryCodeRepository.php
More file actions
46 lines (39 loc) · 1.12 KB
/
Copy pathCountryCodeRepository.php
File metadata and controls
46 lines (39 loc) · 1.12 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* Ushahidi Config Repository, using Kohana::$config
*
* @author Ushahidi Team <team@ushahidi.com>
* @package Ushahidi\Application
* @copyright 2014 Ushahidi
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3)
*/
namespace Ushahidi\App\Repository;
use Ushahidi\Core\Entity\CountryCode;
use Ushahidi\Core\Entity\CountryCodeRepository as CountryCodeRepositoryContract;
use Ushahidi\Core\SearchData;
use Ushahidi\Core\Usecase\ReadRepository;
use Ushahidi\Core\Usecase\SearchRepository;
class CountryCodeRepository extends OhanzeeRepository implements
CountryCodeRepositoryContract,
ReadRepository,
SearchRepository
{
// OhanzeeRepository
protected function getTable()
{
return 'country_codes';
}
public function getSearchFields()
{
return ['country_code', 'dial_code'];
}
public function setSearchConditions(SearchData $search)
{
$query = $this->search_query;
return $query;
}
public function getEntity(array $data = null)
{
return new CountryCode($data);
}
}