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

SettingRepository::saveMany()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 1
nop 1
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