public function addOwner(UserId $userId) { if (!$this->isOwner($userId) && $this->isOrganizationMember($userId)) { $this->removeOrganizationMember($userId); } $owner = new Owner(OwnerId::generate(), $userId, $this); $this->owners->add($owner); $this->updatedOn = new \DateTimeImmutable(); $this->publish(new OwnerAdded($owner->id(), $userId, $this->id)); }
public function convertToPHPValue($value, AbstractPlatform $platform) : OwnerId { return OwnerId::generate($value); }