| @@ 412-427 (lines=16) @@ | ||
| 409 | } |
|
| 410 | ||
| 411 | ||
| 412 | public function jsonSerialize() { |
|
| 413 | return [ |
|
| 414 | 'circle_id' => $this->getCircleId(), |
|
| 415 | 'member_id' => $this->getMemberId(), |
|
| 416 | 'user_id' => $this->getUserId(), |
|
| 417 | 'user_type' => $this->getType(), |
|
| 418 | 'cached_name' => $this->getCachedName(), |
|
| 419 | 'contact_id' => $this->getContactId(), |
|
| 420 | 'level' => $this->getLevel(), |
|
| 421 | 'level_string' => $this->getLevelString(), |
|
| 422 | 'status' => $this->getStatus(), |
|
| 423 | 'instance' => $this->getInstance(), |
|
| 424 | 'note' => $this->getNote(), |
|
| 425 | 'joined' => $this->getJoined() |
|
| 426 | ]; |
|
| 427 | } |
|
| 428 | ||
| 429 | public function getLevelString() { |
|
| 430 | switch ($this->getLevel()) { |
|
| @@ 452-468 (lines=17) @@ | ||
| 449 | /** |
|
| 450 | * @return string[] |
|
| 451 | */ |
|
| 452 | public function jsonSerialize(): array { |
|
| 453 | return array_filter( |
|
| 454 | [ |
|
| 455 | 'id' => $this->getId(), |
|
| 456 | 'circle_id' => $this->getCircleId(), |
|
| 457 | 'user_id' => $this->getUserId(), |
|
| 458 | 'user_type' => $this->getUserType(), |
|
| 459 | 'instance' => $this->getInstance(), |
|
| 460 | 'level' => $this->getLevel(), |
|
| 461 | 'status' => $this->getStatus(), |
|
| 462 | 'cached_name' => $this->getCachedName(), |
|
| 463 | 'cached_update' => $this->getCachedUpdate(), |
|
| 464 | 'note' => $this->getNote(), |
|
| 465 | 'contact_id' => $this->getContactId(), |
|
| 466 | 'contact_meta' => $this->getContactMeta(), |
|
| 467 | 'joined' => $this->getJoined() |
|
| 468 | ] |
|
| 469 | ); |
|
| 470 | } |
|
| 471 | ||