| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Class UserCustomer
- *
- * @property int $user_id
- * @property int $customer_id
- */
- class UserCustomer extends Model {
- protected static $table = "user_customer";
- protected static $id_field = ["user_id", "customer_id"];
- protected static $fillable_fields = ["user_id", "customer_id"];
- // Object methods
- /**
- * @return User|null
- * @throws Exception
- */
- public function getUser(): ?User {
- return User::get($this->user_id);
- }
- /**
- * @return Customer|null
- * @throws Exception
- */
- public function getCustomer(): ?Customer {
- return Customer::get($this->customer_id);
- }
- }
|