mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 02:36:28 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| use LaravelBook\Ardent\Ardent as Ardent;
 | |
| 
 | |
| 
 | |
| /**
 | |
|  * PiggybankEvent
 | |
|  *
 | |
|  * @property integer                  $id
 | |
|  * @property \Carbon\Carbon           $created_at
 | |
|  * @property \Carbon\Carbon           $updated_at
 | |
|  * @property integer                  $piggybank_id
 | |
|  * @property \Carbon\Carbon           $date
 | |
|  * @property float                    $amount
 | |
|  * @property integer                  $transaction_journal_id
 | |
|  * @property-read \Piggybank          $piggybank
 | |
|  * @property-read \TransactionJournal $transactionJournal
 | |
|  * @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 whereTransactionJournalId($value)
 | |
|  */
 | |
| class PiggybankEvent extends Ardent
 | |
| {
 | |
| 
 | |
|     public static $rules
 | |
|         = [
 | |
|             'piggybank_id' => 'required|exists:piggybanks,id',
 | |
|             'date'         => 'required|date',
 | |
|             'amount'       => 'required|numeric'
 | |
|         ];
 | |
| 
 | |
|     /**
 | |
|      * @return array
 | |
|      */
 | |
|     public function getDates()
 | |
|     {
 | |
|         return ['created_at', 'updated_at', 'date'];
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | |
|      */
 | |
|     public function piggybank()
 | |
|     {
 | |
|         return $this->belongsTo('Piggybank');
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | |
|      */
 | |
|     public function transactionJournal()
 | |
|     {
 | |
|         return $this->belongsTo('TransactionJournal');
 | |
|     }
 | |
| 
 | |
| } 
 |