This commit is contained in:
2021-06-28 23:15:13 -04:00
parent 0061a3d920
commit f4a8db56ff
93 changed files with 2422 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<?php
namespace ProVM\Crypto;
use ProVM\Common\Alias\Model;
use ProVM\Common\Define\Model\DateTime as DT;
/**
* @property int $id
* @property \DateTime $date_time
* @property Coin $coin_id
* @property Wallet $wallet_id
* @property float $amount
* @property float $value
* @property Coin $unit_id
*/
class Transaction extends Model {
use DT;
protected static $_table = 'transactions';
protected static $fields = ['date_time', 'coin_id', 'wallet_id', 'amount', 'value', 'unit_id'];
protected $coin;
public function coin() {
if ($this->coin === null) {
$this->coin = $this->childOf(Coin::class, [Model::SELF_KEY => 'coin_id']);
}
return $this->coin;
}
protected $wallet;
public function wallet() {
if ($this->wallet === null) {
$this->wallet = $this->childOf(Wallet::class, [Model::SELF_KEY => 'wallet_id']);
}
return $this->wallet;
}
protected $unit;
public function unit() {
if ($this->unit === null) {
$this->unit = $this->childOf(Coin::class, [Model::SELF_KEY => 'unit_id']);
}
return $this->unit;
}
}