mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-04 05:15:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			113 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			113 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
/**
 | 
						|
 * CurrencyRepositoryInterface.php
 | 
						|
 * Copyright (C) 2016 thegrumpydictator@gmail.com
 | 
						|
 *
 | 
						|
 * 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.
 | 
						|
 */
 | 
						|
 | 
						|
declare(strict_types = 1);
 | 
						|
 | 
						|
namespace FireflyIII\Repositories\Currency;
 | 
						|
 | 
						|
 | 
						|
use FireflyIII\Models\Preference;
 | 
						|
use FireflyIII\Models\TransactionCurrency;
 | 
						|
use Illuminate\Support\Collection;
 | 
						|
 | 
						|
/**
 | 
						|
 * Interface CurrencyRepositoryInterface
 | 
						|
 *
 | 
						|
 * @package FireflyIII\Repositories\Currency
 | 
						|
 */
 | 
						|
interface CurrencyRepositoryInterface
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * @param TransactionCurrency $currency
 | 
						|
     *
 | 
						|
     * @return bool
 | 
						|
     */
 | 
						|
    public function canDeleteCurrency(TransactionCurrency $currency): bool;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param TransactionCurrency $currency
 | 
						|
     *
 | 
						|
     * @return int
 | 
						|
     */
 | 
						|
    public function countJournals(TransactionCurrency $currency): int;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param TransactionCurrency $currency
 | 
						|
     *
 | 
						|
     * @return bool
 | 
						|
     */
 | 
						|
    public function destroy(TransactionCurrency $currency): bool;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Find by ID
 | 
						|
     *
 | 
						|
     * @param int $currencyId
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function find(int $currencyId): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Find by currency code
 | 
						|
     *
 | 
						|
     * @param string $currencyCode
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function findByCode(string $currencyCode): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Find by currency name
 | 
						|
     *
 | 
						|
     * @param string $currencyName
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function findByName(string $currencyName): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * Find by currency symbol
 | 
						|
     *
 | 
						|
     * @param string $currencySymbol
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function findBySymbol(string $currencySymbol): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return Collection
 | 
						|
     */
 | 
						|
    public function get(): Collection;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param Preference $preference
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function getCurrencyByPreference(Preference $preference): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param array $data
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function store(array $data): TransactionCurrency;
 | 
						|
 | 
						|
    /**
 | 
						|
     * @param TransactionCurrency $currency
 | 
						|
     * @param array               $data
 | 
						|
     *
 | 
						|
     * @return TransactionCurrency
 | 
						|
     */
 | 
						|
    public function update(TransactionCurrency $currency, array $data): TransactionCurrency;
 | 
						|
 | 
						|
}
 |