mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Some work on the category controller.
This commit is contained in:
@@ -4,15 +4,15 @@ use LaravelBook\Ardent\Ardent as Ardent;
|
||||
/**
|
||||
* Account
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $user_id
|
||||
* @property integer $account_type_id
|
||||
* @property string $name
|
||||
* @property boolean $active
|
||||
* @property-read \AccountType $accountType
|
||||
* @property-read \User $user
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $user_id
|
||||
* @property integer $account_type_id
|
||||
* @property string $name
|
||||
* @property boolean $active
|
||||
* @property-read \AccountType $accountType
|
||||
* @property-read \User $user
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
|
||||
* @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
|
||||
@@ -92,7 +92,8 @@ class Account extends Ardent
|
||||
);
|
||||
}
|
||||
|
||||
public function predict(\Carbon\Carbon $date) {
|
||||
public function predict(\Carbon\Carbon $date)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@@ -4,10 +4,10 @@
|
||||
/**
|
||||
* AccountType
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $description
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $description
|
||||
* @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)
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* @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)
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
|
||||
*/
|
||||
class Budget extends Component
|
||||
{
|
||||
@@ -35,8 +35,9 @@ class Budget extends Component
|
||||
return $this->hasMany('Limit', 'component_id');
|
||||
}
|
||||
|
||||
public function transactionjournals() {
|
||||
return $this->belongsToMany('TransactionJournal','component_transaction_journal','component_id');
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->belongsToMany('TransactionJournal', 'component_transaction_journal', 'component_id');
|
||||
}
|
||||
|
||||
}
|
@@ -18,7 +18,7 @@
|
||||
* @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)
|
||||
* @property-read \Limit $limits
|
||||
* @property-read \Limit $limits
|
||||
*/
|
||||
class Category extends Component
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@
|
||||
* @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)
|
||||
* @property-read \Limit $limits
|
||||
* @property-read \Limit $limits
|
||||
*/
|
||||
class Component extends Firefly\Database\SingleTableInheritanceEntity
|
||||
{
|
||||
|
@@ -98,10 +98,10 @@ class LimitRepetition extends Ardent
|
||||
. '"!');
|
||||
break;
|
||||
case 'daily':
|
||||
return $this->startdate->format('Ymd').'-5';
|
||||
return $this->startdate->format('Ymd') . '-5';
|
||||
break;
|
||||
case 'weekly':
|
||||
return $this->startdate->format('Ymd').'4';
|
||||
return $this->startdate->format('Ymd') . '4';
|
||||
break;
|
||||
case 'monthly':
|
||||
return $this->startdate->format('Ymd') . '-3';
|
||||
@@ -113,7 +113,7 @@ class LimitRepetition extends Ardent
|
||||
return $this->startdate->format('Ymd') . '-1';
|
||||
break;
|
||||
case 'yearly':
|
||||
return $this->startdate->format('Ymd').'-0';
|
||||
return $this->startdate->format('Ymd') . '-0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -6,13 +6,13 @@ use LaravelBook\Ardent\Ardent;
|
||||
/**
|
||||
* Preference
|
||||
*
|
||||
* @property integer $id
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $user_id
|
||||
* @property string $name
|
||||
* @property string $data
|
||||
* @property-read \User $user
|
||||
* @property integer $user_id
|
||||
* @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)
|
||||
|
@@ -6,18 +6,18 @@ use LaravelBook\Ardent\Ardent;
|
||||
/**
|
||||
* Transaction
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $account_id
|
||||
* @property integer $transaction_journal_id
|
||||
* @property string $description
|
||||
* @property float $amount
|
||||
* @property-read \Account $account
|
||||
* @property-read \TransactionJournal $transactionJournal
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property integer $account_id
|
||||
* @property integer $transaction_journal_id
|
||||
* @property string $description
|
||||
* @property float $amount
|
||||
* @property-read \Account $account
|
||||
* @property-read \TransactionJournal $transactionJournal
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
|
||||
* @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)
|
||||
@@ -61,11 +61,11 @@ class Transaction extends Ardent
|
||||
|
||||
public function budgets()
|
||||
{
|
||||
return $this->belongsToMany('Budget','component_transaction','transaction_id','component_id');
|
||||
return $this->belongsToMany('Budget', 'component_transaction', 'transaction_id', 'component_id');
|
||||
}
|
||||
|
||||
public function categories()
|
||||
{
|
||||
return $this->belongsToMany('Category','component_transaction','transaction_id','component_id');
|
||||
return $this->belongsToMany('Category', 'component_transaction', 'transaction_id', 'component_id');
|
||||
}
|
||||
}
|
@@ -4,10 +4,10 @@
|
||||
/**
|
||||
* TransactionCurrency
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $code
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @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)
|
||||
|
@@ -63,6 +63,7 @@ class TransactionJournal extends Ardent
|
||||
public static function factory()
|
||||
{
|
||||
$date = new \Carbon\Carbon;
|
||||
|
||||
return [
|
||||
'transaction_type_id' => 'factory|TransactionType',
|
||||
'transaction_currency_id' => 'factory|TransactionCurrency',
|
||||
|
@@ -4,23 +4,26 @@
|
||||
/**
|
||||
* TransactionType
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $type
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @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)
|
||||
*/
|
||||
class TransactionType extends Eloquent {
|
||||
public function transactionJournals() {
|
||||
class TransactionType extends Eloquent
|
||||
{
|
||||
public function transactionJournals()
|
||||
{
|
||||
return $this->hasMany('TransactionJournal');
|
||||
}
|
||||
|
||||
public static $factory = [
|
||||
'type' => 'string'
|
||||
];
|
||||
public static $factory
|
||||
= [
|
||||
'type' => 'string'
|
||||
];
|
||||
|
||||
}
|
@@ -10,19 +10,19 @@ use LaravelBook\Ardent\Ardent;
|
||||
/**
|
||||
* User
|
||||
*
|
||||
* @property integer $id
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property string $reset
|
||||
* @property string $remember_token
|
||||
* @property boolean $migrated
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
|
||||
* @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 string $email
|
||||
* @property string $password
|
||||
* @property string $reset
|
||||
* @property string $remember_token
|
||||
* @property boolean $migrated
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
|
||||
* @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)
|
||||
@@ -92,7 +92,8 @@ class User extends Ardent implements UserInterface, RemindableInterface
|
||||
return $this->hasMany('Category');
|
||||
}
|
||||
|
||||
public function transactionjournals() {
|
||||
public function transactionjournals()
|
||||
{
|
||||
return $this->hasMany('TransactionJournal');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user