2014-10-28 05:58:48 +01:00
|
|
|
<?php
|
|
|
|
|
2014-12-13 22:11:51 +01:00
|
|
|
namespace FireflyIII\Database\TransactionCurrency;
|
2014-12-23 22:27:29 +01:00
|
|
|
use FireflyIII\Database\CommonDatabaseCalls;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
use FireflyIII\Exception\NotImplementedException;
|
2014-10-28 05:58:48 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class TransactionType
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Database
|
|
|
|
*/
|
2014-12-23 22:27:29 +01:00
|
|
|
class TransactionCurrency implements TransactionCurrencyInterface, CommonDatabaseCalls
|
2014-10-28 05:58:48 +01:00
|
|
|
{
|
|
|
|
|
2014-11-02 14:58:12 +01:00
|
|
|
/**
|
2014-11-12 22:37:09 +01:00
|
|
|
* @param string $code
|
2014-11-12 22:21:48 +01:00
|
|
|
*
|
2014-11-12 22:37:09 +01:00
|
|
|
* @return \TransactionCurrency|null
|
2014-11-02 14:58:12 +01:00
|
|
|
*/
|
2014-11-12 22:37:09 +01:00
|
|
|
public function findByCode($code)
|
2014-11-02 14:58:12 +01:00
|
|
|
{
|
2014-11-12 22:37:09 +01:00
|
|
|
return \TransactionCurrency::whereCode($code)->first();
|
2014-11-02 14:58:12 +01:00
|
|
|
}
|
2014-12-23 22:27:29 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns an object with id $id.
|
|
|
|
*
|
|
|
|
* @param int $objectId
|
|
|
|
*
|
|
|
|
* @return \Eloquent
|
|
|
|
*/
|
|
|
|
public function find($objectId)
|
|
|
|
{
|
|
|
|
// TODO: Implement find() method.
|
|
|
|
throw new NotImplementedException;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
|
|
|
|
*
|
|
|
|
* @param $what
|
|
|
|
*
|
|
|
|
* @return \AccountType|null
|
|
|
|
*/
|
|
|
|
public function findByWhat($what)
|
|
|
|
{
|
|
|
|
// TODO: Implement findByWhat() method.
|
|
|
|
throw new NotImplementedException;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns all objects.
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function get()
|
|
|
|
{
|
|
|
|
return \TransactionCurrency::orderBy('code','ASC')->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param array $objectIds
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getByIds(array $objectIds)
|
|
|
|
{
|
|
|
|
// TODO: Implement getByIds() method.
|
|
|
|
throw new NotImplementedException;
|
|
|
|
}
|
2014-10-28 05:58:48 +01:00
|
|
|
}
|