public function addOrganizationMember(UserId $userId) { if ($this->isOwner($userId)) { throw new OrganizationMemberIsAlreadyAnOwnerException($userId); } $organizationMember = new OrganizationMember(OrganizationMemberId::generate(), $userId, $this); $this->organizationMembers->add($organizationMember); $this->updatedOn = new \DateTimeImmutable(); $this->publish(new OrganizationMemberAdded($organizationMember->id(), $userId, $this->id)); }
public function convertToPHPValue($value, AbstractPlatform $platform) : OrganizationMemberId { return OrganizationMemberId::generate($value); }