Skip to content

Commit

Permalink
fix missing areaOfInterestLcl
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Jun 22, 2024
1 parent 9df970e commit c6f1891
Showing 1 changed file with 29 additions and 27 deletions.
56 changes: 29 additions & 27 deletions src/AnniversaryCalculator/LitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,41 +58,43 @@ class LitEvent
public ?string $anniversaryLcl;
public ?string $patronage;
public int $yearDiff;
private array $GTXT;
private static array $GTXT = [];

public function __construct(array $rowData)
{
if (count(self::$GTXT) === 0) {
self::$GTXT = [
"CENTENARY" => _("CENTENARY"),
"ONYX" => _("ONYX"),
"GRANITE" => _("GRANITE"),
"MARBLE" => _("MARBLE"),
"OAK" => _("OAK"),
"PLATINUM" => _("PLATINUM"),
"IRON" => _("IRON"),
"STONE" => _("STONE"),
"DIAMOND" => _("DIAMOND"),
"EMERALD" => _("EMERALD"),
"GOLD" => _("GOLD"),
"SAPPHIRE" => _("SAPPHIRE"),
"RUBY" => _("RUBY"),
"CORAL" => _("CORAL"),
"PEARL" => _("PEARL"),
"SILVER" => _("SILVER"),
"PORCELAIN" => _("PORCELAIN"),
"CRISTAL" => _("CRISTAL"),
"ALUMINUM" => _("ALUMINUM"),
"WOOD" => _("WOOD"),
"PAPER" => _("PAPER")
];
}
$AnnivType = new AnnivType();
$AreaInterest = new AreaInterest();
$LitCalendar = new LitCalendar();
$this->GTXT = [
"CENTENARY" => _("CENTENARY"),
"ONYX" => _("ONYX"),
"GRANITE" => _("GRANITE"),
"MARBLE" => _("MARBLE"),
"OAK" => _("OAK"),
"PLATINUM" => _("PLATINUM"),
"IRON" => _("IRON"),
"STONE" => _("STONE"),
"DIAMOND" => _("DIAMOND"),
"EMERALD" => _("EMERALD"),
"GOLD" => _("GOLD"),
"SAPPHIRE" => _("SAPPHIRE"),
"RUBY" => _("RUBY"),
"CORAL" => _("CORAL"),
"PEARL" => _("PEARL"),
"SILVER" => _("SILVER"),
"PORCELAIN" => _("PORCELAIN"),
"CRISTAL" => _("CRISTAL"),
"ALUMINUM" => _("ALUMINUM"),
"WOOD" => _("WOOD"),
"PAPER" => _("PAPER")
];
$this->idx = $rowData["IDX"];
$this->tag = $rowData["TAG"];

$this->subject = $rowData["SUBJECT"];
$this->anniversaryType = $rowData["ANNIVERSARY"];
$this->anniversaryType = $AnnivType->isValid($rowData["ANNIVERSARY"]) ? strtoupper($rowData["ANNIVERSARY"]) : '???';
$this->anniversaryTypeLcl = $AnnivType->i18n($rowData["ANNIVERSARY"]);
$this->year = $rowData["YEAR"];
$this->eventMonth = $rowData["EVENT_MONTH"];
Expand All @@ -107,15 +109,15 @@ public function __construct(array $rowData)
$this->mainShrine = $rowData["MAIN_SHRINE"];
$this->places = $rowData["PLACES"];
$this->areaOfInterest = $rowData["AREA"] ? explode(",", $rowData["AREA"]) : [];
$this->areaOfInterest = $rowData["AREA"] ? $AreaInterest->i18n(explode(",", $rowData["AREA"])) : [];
$this->areaOfInterestLcl = $rowData["AREA"] ? $AreaInterest->i18n(explode(",", $rowData["AREA"])) : [];
$this->notes = $rowData["NOTES"];
$this->patronage = $rowData["PATRONAGE"];
}

public function setAnniversary(int $anniv)
{
$this->anniversary = array_search($anniv, self::ANNIVERSARY);
$this->anniversaryLcl = $this->GTXT[ $this->anniversary ];
$this->anniversaryLcl = self::$GTXT[ $this->anniversary ];
}

public function setYearDiff(int $yearDiff)
Expand Down

0 comments on commit c6f1891

Please sign in to comment.