Completed
Push — master ( a2ea8b...2c4876 )
by Sherif
02:24
created

SettingRepository   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 4 1
A saveMany() 0 9 2
1
<?php namespace App\Modules\V1\Core\Repositories;
2
3
use App\Modules\V1\Core\AbstractRepositories\AbstractRepository;
4
5
class SettingRepository extends AbstractRepository
6
{
7
	/**
8
	 * Return the model full namespace.
9
	 * 
10
	 * @return string
11
	 */
12
	protected function getModel()
13
	{
14
		return 'App\Modules\V1\Core\Settings';
15
	}
16
17
    /**
18
     * Save list of settings.
19
     *
20
     * @param  array   $data
21
     * @return void
22
     */
23
    public function saveMany(array $data)
24
    {
25
    	\DB::transaction(function () use ($data) {
26
    		foreach ($data as $key => $value) 
27
    		{
28
    			$this->save($value);
29
    		}
30
    	});
31
    }
32
}
33