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; } }