/** * @param UserId $userId * @return EncryptedWallet[] */ public function walletsOfUserId(UserId $userId) { /** @var EncryptedWalletDocument[] $result */ $result = $this->repository->query()->where('userId', '==', $userId->getValue())->execute(); $encryptedWallets = $this->documentArrayToObjectArray($result); return $encryptedWallets; }
/** * @return array */ public function toArray() { $entityAsArray = array(); $entityAsArray['id'] = $this->id->toArray(); $entityAsArray['userId'] = $this->userId->toArray(); $entityAsArray['name'] = $this->name; $entityAsArray['coinSymbol'] = $this->coinSymbol; $entityAsArray['token'] = $this->token; $entityAsArray['creationTime'] = clone $this->creationTime; return $entityAsArray; }