Skip to content

Commit

Permalink
Feature / Queue (#120)
Browse files Browse the repository at this point in the history
Fix wallet share mail hydrating. Update dependencies
  • Loading branch information
vokomarov authored May 28, 2023
2 parents 50ad88f + 809f02e commit 40f0ad6
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 176 deletions.
1 change: 1 addition & 0 deletions app/config/translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'fallbackLocale' => env('LOCALE', 'en'),
'directory' => directory('locale'),
'autoRegister' => env('DEBUG', true),
'cacheLocales' => false,

// available locale loaders (the key is extension)
'loaders' => [
Expand Down
15 changes: 15 additions & 0 deletions app/src/Mail/WalletShareMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@
namespace App\Mail;

use App\Database\EntityHeader;
use App\Database\User;
use App\Database\Wallet;
use App\Service\Mailer\Mail;
use Cycle\ORM\ORMInterface;
use Spiral\Translator\Traits\TranslatorTrait;

class WalletShareMail extends UserMail
{
use TranslatorTrait;

public ?User $sharer = null;

public ?Wallet $wallet = null;

/**
* @param \App\Database\EntityHeader<\App\Database\User> $userHeader
* @param \App\Database\EntityHeader<\App\Database\User> $sharerHeader
Expand All @@ -27,6 +34,14 @@ public function __construct(
parent::__construct($userHeader);
}

public function hydrate(ORMInterface $orm)
{
parent::hydrate($orm);

$this->sharer = $this->sharerHeader->hydrate($orm);
$this->wallet = $this->walletHeader->hydrate($orm);
}

/**
* {@inheritDoc}
*/
Expand Down
Loading

0 comments on commit 40f0ad6

Please sign in to comment.