feature/RVRNEXT-43-split-transactions #59
60
src/PersistentData/Model/TransactionPayee.php
Normal file
60
src/PersistentData/Model/TransactionPayee.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php namespace RVR\PersistentData\Model;
|
||||
|
||||
use SokoWeb\PersistentData\Model\Model;
|
||||
|
||||
class TransactionPayee extends Model
|
||||
{
|
||||
protected static string $table = 'transaction_payees';
|
||||
|
||||
protected static array $fields = ['transaction_id', 'user_id'];
|
||||
|
||||
protected static array $relations = ['transaction' => Transaction::class, 'user' => User::class];
|
||||
|
||||
private ?Transaction $transaction = null;
|
||||
|
||||
private ?int $transactionId = null;
|
||||
|
||||
private ?User $user = null;
|
||||
|
||||
private ?int $userId = null;
|
||||
|
||||
public function setTransaction(Transaction $transaction): void
|
||||
{
|
||||
$this->transaction = $transaction;
|
||||
}
|
||||
|
||||
public function setTransactionId(int $transactionId): void
|
||||
{
|
||||
$this->transactionId = $transactionId;
|
||||
}
|
||||
|
||||
public function setUser(User $user): void
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function setUserId(int $userId): void
|
||||
{
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
public function getTransaction(): ?Transaction
|
||||
{
|
||||
return $this->transaction;
|
||||
}
|
||||
|
||||
public function getTransactionId(): ?int
|
||||
{
|
||||
return $this->transactionId;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getUserId(): ?int
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user