-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add configuration decoding & send mail wip
- Loading branch information
1 parent
2a86a4e
commit 97371d0
Showing
6 changed files
with
148 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace ShopBundle\Component\NoShow; | ||
|
||
use CommonBundle\Entity\User\Person; | ||
|
||
class NoShowConfig { | ||
/** | ||
* @var array Stores the email related to each warning | ||
*/ | ||
private array $emailDictionary; | ||
|
||
/** | ||
* @var array Stores the amount of ban days related to each warning | ||
*/ | ||
private array $banDaysDictionary; | ||
|
||
public function __construct($configJson) { | ||
$decodedConfig = json_decode($configJson, true); | ||
|
||
$this->emailDictionary = []; | ||
$this->banDaysDictionary = []; | ||
|
||
foreach ($decodedConfig['warnings'] as $index => $warning) { | ||
$this->emailDictionary[$index] = $warning['email_message']; | ||
$this->banDaysDictionary[$index] = $warning['ban_days']; | ||
} | ||
} | ||
|
||
/** | ||
* @return array Returns a dictionary with the emails for each warning | ||
*/ | ||
public function getEmailDictionary() { | ||
return $this->emailDictionary; | ||
} | ||
|
||
/** | ||
* @return array Returns a dictionary with the amount of ban days for each warning | ||
*/ | ||
public function getBanDaysDictionary() { | ||
return $this->banDaysDictionary; | ||
} | ||
|
||
public function createBan(Person $person, int $warningCount) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters