2018-09-11 04:11:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Webkul\Customer\Repositories;
|
|
|
|
|
|
|
|
|
|
use Webkul\Core\Eloquent\Repository;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CustomerGroup Reposotory
|
|
|
|
|
*
|
|
|
|
|
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
|
|
|
|
|
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class CustomerGroupRepository extends Repository
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Specify Model class name
|
|
|
|
|
*
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
function model()
|
|
|
|
|
{
|
2019-02-18 07:30:40 +00:00
|
|
|
return 'Webkul\Customer\Contracts\CustomerGroup';
|
2018-09-11 04:11:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param array $data
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function create(array $data)
|
|
|
|
|
{
|
|
|
|
|
$customer = $this->model->create($data);
|
|
|
|
|
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param array $data
|
|
|
|
|
* @param $id
|
|
|
|
|
* @param string $attribute
|
|
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function update(array $data, $id, $attribute = "id")
|
|
|
|
|
{
|
|
|
|
|
$customer = $this->find($id);
|
|
|
|
|
|
|
|
|
|
$customer->update($data);
|
|
|
|
|
|
|
|
|
|
return $customer;
|
|
|
|
|
}
|
|
|
|
|
}
|