firefly-iii/app/Repositories/User/UserRepositoryInterface.php

67 lines
1.2 KiB
PHP
Raw Normal View History

2016-03-12 07:18:28 -06:00
<?php
/**
* UserRepositoryInterface.php
2016-04-01 09:44:46 -05:00
* Copyright (C) 2016 thegrumpydictator@gmail.com
2016-03-12 07:18:28 -06:00
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
2016-03-12 07:18:28 -06:00
*/
declare(strict_types = 1);
2016-03-12 07:18:28 -06:00
namespace FireflyIII\Repositories\User;
use FireflyIII\User;
2016-04-03 00:07:17 -05:00
use Illuminate\Support\Collection;
2016-03-12 07:18:28 -06:00
/**
* Interface UserRepositoryInterface
*
* @package FireflyIII\Repositories\User
*/
interface UserRepositoryInterface
{
2016-04-03 00:07:17 -05:00
/**
2016-04-26 01:09:10 -05:00
* Returns a collection of all users.
*
2016-04-03 00:07:17 -05:00
* @return Collection
*/
public function all(): Collection;
2016-03-12 07:18:28 -06:00
/**
2016-04-26 01:09:10 -05:00
* Gives a user a role.
*
2016-03-12 07:18:28 -06:00
* @param User $user
* @param string $role
*
* @return bool
*/
public function attachRole(User $user, string $role): bool;
/**
2016-04-26 01:09:10 -05:00
* Returns a count of all users.
2016-04-26 14:40:15 -05:00
*
2016-03-12 07:18:28 -06:00
* @return int
*/
public function count(): int;
2016-10-22 02:33:03 -05:00
/**
* @param int $userId
*
* @return User
*/
public function find(int $userId): User;
/**
* Return basic user information.
*
* @param User $user
*
* @return array
*/
public function getUserData(User $user): array;
2016-03-14 14:38:23 -05:00
}