Cleanup all models and migrations.

This commit is contained in:
Sander Dorigo 2014-11-10 18:33:00 +01:00
parent 754336b3cf
commit 359e1b3943
23 changed files with 353 additions and 226 deletions

View File

@ -3,40 +3,41 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateImportentriesTable extends Migration {
class CreateImportentriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('importentries', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
$table->string('class',200);
$table->integer('importmap_id')->unsigned();
$table->integer('old')->unsigned();
$table->integer('new')->unsigned();
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(
'importentries', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('class', 200);
$table->integer('importmap_id')->unsigned();
$table->integer('old')->unsigned();
$table->integer('new')->unsigned();
// map import entries to import map.
// connect accounts to account_types
$table->foreign('importmap_id')
->references('id')->on('importmaps')
->onDelete('cascade');
});
}
// connect import map.
$table->foreign('importmap_id')
->references('id')->on('importmaps')
->onDelete('cascade');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('importentries');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('importentries');
}
}

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountMeta extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create(
'account_meta', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('account_id')->unsigned();
$table->string('name');
$table->text('data');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('account_meta');
}
}

View File

@ -16,14 +16,14 @@ use LaravelBook\Ardent\Builder;
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \Illuminate\Database\Eloquent\Collection|\Piggybank[] $piggybanks
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereActive($value)
* @method static \Account accountTypeIn($types)
* @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereActive($value)
* @method static \Account accountTypeIn($types)
*/
class Account extends Ardent
{
@ -42,17 +42,7 @@ class Account extends Ardent
];
protected $fillable = ['name','user_id','account_type_id','active'];
/**
* Account type.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function accountType()
{
return $this->belongsTo('AccountType');
}
protected $fillable = ['name', 'user_id', 'account_type_id', 'active'];
/**
* Get an accounts current balance.
@ -68,26 +58,41 @@ class Account extends Ardent
return floatval(
$this->transactions()
->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)
->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->sum('transactions.amount')
);
}
/**
* @param TransactionJournal $journal
*
* @return float
*/
public function balanceBeforeJournal(TransactionJournal $journal)
{
return floatval(
$this->transactions()
->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)
->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d'))
->where('transaction_journals.created_at', '<=', $journal->created_at->format('Y-m-d H:i:s'))
->where('transaction_journals.id','!=',$journal->id)
->sum('transactions.amount')
->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
)
->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d'))
->where('transaction_journals.created_at', '<=', $journal->created_at->format('Y-m-d H:i:s'))
->where('transaction_journals.id', '!=', $journal->id)
->sum('transactions.amount')
);
}
/**
* Account type.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function accountType()
{
return $this->belongsTo('AccountType');
}
/**
* Transactions.
*
@ -114,8 +119,7 @@ class Account extends Ardent
public function predict(
/** @noinspection PhpUnusedParameterInspection */
\Carbon\Carbon $date
)
{
) {
return null;
}
@ -129,12 +133,17 @@ class Account extends Ardent
return $this->belongsTo('User');
}
public function scopeAccountTypeIn(Builder $query, array $types) {
if(is_null($this->joinedAccountTypes)) {
$query->leftJoin('account_types','account_types.id','=','accounts.account_type_id');
/**
* @param Builder $query
* @param array $types
*/
public function scopeAccountTypeIn(Builder $query, array $types)
{
if (is_null($this->joinedAccountTypes)) {
$query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id');
$this->joinedAccountTypes = true;
}
$query->whereIn('account_types.type',$types);
$query->whereIn('account_types.type', $types);
}

View File

@ -0,0 +1,35 @@
<?php
use LaravelBook\Ardent\Ardent as Ardent;
/**
* AccountMeta
*
* @property-read \Account $account
*/
class AccountMeta extends Ardent
{
/**
* @var array
*/
public static $rules
= [
'account_id' => 'numeric|required|exists:accounts,id',
'name' => 'required|between:1,250',
'data' => 'required'
];
/**
* @var array
*/
protected $fillable = ['account_id', 'name', 'date'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('Account');
}
}

View File

@ -11,11 +11,11 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property string $type
* @property boolean $editable
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
* @method static \Illuminate\Database\Query\Builder|\AccountType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereType($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereEditable($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereType($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereEditable($value)
*/
class AccountType extends Eloquent
{

View File

@ -13,12 +13,12 @@
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereClass($value)
*/
class Budget extends Component
{

View File

@ -13,12 +13,12 @@
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Category whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereClass($value)
*/
class Category extends Component
{

View File

@ -14,12 +14,12 @@ use Firefly\Database\SingleTableInheritanceEntity;
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Component whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereClass($value)
*/
class Component extends SingleTableInheritanceEntity
{

View File

@ -1,9 +1,9 @@
<?php
use Illuminate\Database\Eloquent\Model as Eloquent;
/**
* Importentry
*
* @property-read \Importmap $importmap
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
@ -11,15 +11,17 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property integer $importmap_id
* @property integer $old
* @property integer $new
* @method static \Illuminate\Database\Query\Builder|\Importentry whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereImportmapId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereOld($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereNew($value)
* @property-read \Importmap $importmap
* @method static \Illuminate\Database\Query\Builder|\Importentry whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereImportmapId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereOld($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereNew($value)
*/
class Importentry extends Eloquent {
class Importentry extends Eloquent
{
public function importmap()
{
return $this->belongsTo('Importmap');

View File

@ -2,23 +2,23 @@
use LaravelBook\Ardent\Ardent as Ardent;
/**
* Class Importmap
* Importmap
*
* @property-read \User $user
* @property integer $id
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $user_id
* @property string $file
* @method static \Illuminate\Database\Query\Builder|\Importmap whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereFile($value)
* @property integer $user_id
* @property string $file
* @property integer $totaljobs
* @property integer $jobsdone
* @method static \Illuminate\Database\Query\Builder|\Importmap whereTotaljobs($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereJobsdone($value)
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Importmap whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereFile($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereTotaljobs($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereJobsdone($value)
*/
class Importmap extends Ardent
{

View File

@ -18,14 +18,14 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property-read \Budget $budget
* @property-read \Component $component
* @property-read \Illuminate\Database\Eloquent\Collection|\LimitRepetition[] $limitrepetitions
* @method static \Illuminate\Database\Query\Builder|\Limit whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereComponentId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereAmount($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeatFreq($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereComponentId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereAmount($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeatFreq($value)
*/
class Limit extends Ardent
{

View File

@ -5,21 +5,21 @@ use LaravelBook\Ardent\Ardent as Ardent;
/**
* LimitRepetition
*
* @property integer $id
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $limit_id
* @property integer $limit_id
* @property \Carbon\Carbon $startdate
* @property \Carbon\Carbon $enddate
* @property float $amount
* @property-read \Limit $limit
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereLimitId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereEnddate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereAmount($value)
* @property float $amount
* @property-read \Limit $limit
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereLimitId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereEnddate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereAmount($value)
*/
class LimitRepetition extends Ardent
{

View File

@ -19,27 +19,28 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property integer $rep_times
* @property string $reminder
* @property integer $reminder_skip
* @property boolean $remind_me
* @property integer $order
* @property-read \Account $account
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankRepetition[] $piggybankrepetitions
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankEvent[] $piggybankevents
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankReminder[] $piggybankreminders
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepEvery($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminderSkip($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereOrder($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepEvery($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminderSkip($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRemindMe($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereOrder($value)
*/
class Piggybank extends Ardent
{

View File

@ -12,12 +12,12 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property \Carbon\Carbon $date
* @property float $amount
* @property-read \Piggybank $piggybank
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereAmount($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereAmount($value)
*/
class PiggybankEvent extends Ardent
{

View File

@ -12,13 +12,13 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property \Carbon\Carbon $targetdate
* @property float $currentamount
* @property-read \Piggybank $piggybank
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCurrentamount($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCurrentamount($value)
*/
class PiggybankRepetition extends Ardent
{

View File

@ -12,12 +12,12 @@ use LaravelBook\Ardent\Ardent;
* @property string $name
* @property string $data
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Preference whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereData($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereData($value)
*/
class Preference extends Ardent
{

View File

@ -18,21 +18,20 @@ use LaravelBook\Ardent\Ardent;
* @property boolean $automatch
* @property string $repeat_freq
* @property integer $skip
* @property-read \Illuminate\Database\Eloquent\Collection|\RecurringTransactionReminder[] $reminders
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereName($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereMatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMax($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMin($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereActive($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAutomatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereRepeatFreq($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereSkip($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereName($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereMatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMax($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMin($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereActive($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAutomatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereRepeatFreq($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereSkip($value)
*/
class RecurringTransaction extends Ardent
{

View File

@ -11,7 +11,6 @@ use LaravelBook\Ardent\Ardent;
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property string $class
* @property integer $user_id
* @property \Carbon\Carbon $startdate
* @property \Carbon\Carbon $enddate
@ -20,7 +19,6 @@ use LaravelBook\Ardent\Ardent;
* @method static \Illuminate\Database\Query\Builder|\Reminder whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereEnddate($value)

View File

@ -8,34 +8,34 @@ use LaravelBook\Ardent\Builder;
/**
* Transaction
*
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $account_id
* @property integer $piggybank_id
* @property integer $transaction_journal_id
* @property string $description
* @property float $amount
* @property-read \Account $account
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $account_id
* @property integer $piggybank_id
* @property integer $transaction_journal_id
* @property string $description
* @property float $amount
* @property-read \Account $account
* @property-read \Piggybank $piggybank
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \Piggybank $piggybank
* @property-read \TransactionJournal $transactionJournal
* @method static \Illuminate\Database\Query\Builder|\Transaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereTransactionJournalId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAmount($value)
* @method static \Transaction accountIs($account)
* @method static \Transaction after($date)
* @method static \Transaction before($date)
* @method static \Transaction lessThan($amount)
* @method static \Transaction moreThan($amount)
* @method static \Transaction transactionTypes($types)
* @property-read \TransactionJournal $transactionJournal
* @method static \Illuminate\Database\Query\Builder|\Transaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereTransactionJournalId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAmount($value)
* @method static \Transaction accountIs($account)
* @method static \Transaction after($date)
* @method static \Transaction before($date)
* @method static \Transaction lessThan($amount)
* @method static \Transaction moreThan($amount)
* @method static \Transaction transactionTypes($types)
*/
class Transaction extends Ardent
{

View File

@ -1,5 +1,6 @@
<?php
use Illuminate\Database\Eloquent\Model as Eloquent;
/**
* TransactionCurrency
*
@ -8,10 +9,10 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property \Carbon\Carbon $updated_at
* @property string $code
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCode($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCode($value)
*/
class TransactionCurrency extends Eloquent
{

View File

@ -4,6 +4,49 @@ use Carbon\Carbon;
use LaravelBook\Ardent\Ardent;
use LaravelBook\Ardent\Builder;
/**
* TransactionJournal
*
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $user_id
* @property integer $transaction_type_id
* @property integer $recurring_transaction_id
* @property integer $transaction_currency_id
* @property string $description
* @property boolean $completed
* @property \Carbon\Carbon $date
* @property-read \Illuminate\Database\Eloquent\Collection|\
* 'Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\
* 'Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \RecurringTransaction $recurringTransaction
* @property-read \TransactionCurrency $transactionCurrency
* @property-read \TransactionType $transactionType
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereTransactionTypeId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereRecurringTransactionId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereTransactionCurrencyId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereCompleted($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereDate($value)
* @method static \TransactionJournal accountIs($account)
* @method static \TransactionJournal after($date)
* @method static \TransactionJournal before($date)
* @method static \TransactionJournal defaultSorting()
* @method static \TransactionJournal moreThan($amount)
* @method static \TransactionJournal lessThan($amount)
* @method static \TransactionJournal onDate($date)
* @method static \TransactionJournal transactionTypes($types)
* @method static \TransactionJournal withRelevantData()
*/
class TransactionJournal extends Ardent
{

View File

@ -10,10 +10,10 @@ use LaravelBook\Ardent\Ardent;
* @property \Carbon\Carbon $updated_at
* @property string $type
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionJournals
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereType($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereType($value)
*/
class TransactionType extends Ardent
{

View File

@ -6,7 +6,6 @@ use Illuminate\Auth\UserInterface;
use Illuminate\Auth\UserTrait;
use LaravelBook\Ardent\Ardent;
/**
* User
*
@ -20,21 +19,19 @@ use LaravelBook\Ardent\Ardent;
* @property boolean $migrated
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\Reminder[] $reminders
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankReminder[] $piggybankreminders
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences
* @property-read \Illuminate\Database\Eloquent\Collection|\RecurringTransaction[] $recurringtransactions
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @method static \Illuminate\Database\Query\Builder|\User whereId($value)
* @method static \Illuminate\Database\Query\Builder|\User whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereEmail($value)
* @method static \Illuminate\Database\Query\Builder|\User wherePassword($value)
* @method static \Illuminate\Database\Query\Builder|\User whereReset($value)
* @method static \Illuminate\Database\Query\Builder|\User whereRememberToken($value)
* @method static \Illuminate\Database\Query\Builder|\User whereMigrated($value)
* @method static \Illuminate\Database\Query\Builder|\User whereId($value)
* @method static \Illuminate\Database\Query\Builder|\User whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereEmail($value)
* @method static \Illuminate\Database\Query\Builder|\User wherePassword($value)
* @method static \Illuminate\Database\Query\Builder|\User whereReset($value)
* @method static \Illuminate\Database\Query\Builder|\User whereRememberToken($value)
* @method static \Illuminate\Database\Query\Builder|\User whereMigrated($value)
*/
class User extends Ardent implements UserInterface, RemindableInterface
{