mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
34 lines
726 B
PHP
34 lines
726 B
PHP
<?php
|
|
|
|
namespace App\Ninja\Repositories;
|
|
|
|
use DB;
|
|
|
|
class UserRepository extends BaseRepository
|
|
{
|
|
public function getClassName()
|
|
{
|
|
return 'App\Models\User';
|
|
}
|
|
|
|
public function find($accountId)
|
|
{
|
|
$query = DB::table('users')
|
|
->where('users.account_id', '=', $accountId);
|
|
|
|
$this->applyFilters($query, ENTITY_USER);
|
|
|
|
$query->select('users.public_id', 'users.first_name', 'users.last_name', 'users.email', 'users.confirmed', 'users.public_id', 'users.deleted_at', 'users.is_admin', 'users.permissions');
|
|
|
|
return $query;
|
|
}
|
|
|
|
public function save($data, $user)
|
|
{
|
|
$user->fill($data);
|
|
$user->save();
|
|
|
|
return $user;
|
|
}
|
|
}
|