type = $type ?? new ItemRelationType(); } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'source' => $this->source, 'destination' => $this->destination, 'type' => $this->type, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }