entityType = $entityType; $this->id = $id; } /** * Get an ID. */ public function getId() : string { return $this->id; } /** * Get an entity type. */ public function getEntityType() : string { return $this->entityType; } /** * Get a name. */ public function getName() : ?string { return $this->name; } /** * Clone with a name. */ public function withName(?string $name) : self { $obj = new self($this->entityType, $this->id); $obj->name = $name; return $obj; } /** * Create from an entity type and ID. */ public static function fromEntityTypeAndId(string $entityType, string $id) : self { return new self($entityType, $id); } }