Skip to content

Commit

Permalink
first define seasons, then vigil masses which inherit season from the…
Browse files Browse the repository at this point in the history
…ir partner celebration
  • Loading branch information
JohnRDOrazio committed Nov 11, 2024
1 parent 8efc226 commit decff89
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/FestivityCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,23 @@ public function inOrdinaryTime(DateTime $date): bool
*/
public function setCyclesVigilsSeasons()
{
// DEFINE LITURGICAL SEASONS
foreach ($this->festivities as $key => $festivity) {
if ($festivity->date >= $this->festivities[ "Advent1" ]->date && $festivity->date < $this->festivities[ "Christmas" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::ADVENT;
} elseif ($festivity->date >= $this->festivities[ "Christmas" ]->date || $festivity->date <= $this->festivities[ "BaptismLord" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::CHRISTMAS;
} elseif ($festivity->date >= $this->festivities[ "AshWednesday" ]->date && $festivity->date < $this->festivities[ "HolyThurs" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::LENT;
} elseif ($festivity->date >= $this->festivities[ "HolyThurs" ]->date && $festivity->date < $this->festivities[ "Easter" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::EASTER_TRIDUUM;
} elseif ($festivity->date >= $this->festivities[ "Easter" ]->date && $festivity->date <= $this->festivities[ "Pentecost" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::EASTER;
} else {
$this->festivities[ $key ]->liturgical_season = LitSeason::ORDINARY_TIME;
}
}

// DEFINE YEAR CYCLES (except for Holy Week and Easter Octave)
foreach ($this->festivities as $key => $festivity) {
if ($festivity->date <= $this->festivities[ "PalmSun" ]->date || $festivity->date >= $this->festivities[ "Easter2" ]->date) {
Expand All @@ -640,23 +657,6 @@ public function setCyclesVigilsSeasons()
}
}
}

// DEFINE LITURGICAL SEASONS
foreach ($this->festivities as $key => $festivity) {
if ($festivity->date >= $this->festivities[ "Advent1" ]->date && $festivity->date < $this->festivities[ "Christmas" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::ADVENT;
} elseif ($festivity->date >= $this->festivities[ "Christmas" ]->date || $festivity->date <= $this->festivities[ "BaptismLord" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::CHRISTMAS;
} elseif ($festivity->date >= $this->festivities[ "AshWednesday" ]->date && $festivity->date < $this->festivities[ "HolyThurs" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::LENT;
} elseif ($festivity->date >= $this->festivities[ "HolyThurs" ]->date && $festivity->date < $this->festivities[ "Easter" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::EASTER_TRIDUUM;
} elseif ($festivity->date >= $this->festivities[ "Easter" ]->date && $festivity->date <= $this->festivities[ "Pentecost" ]->date) {
$this->festivities[ $key ]->liturgical_season = LitSeason::EASTER;
} else {
$this->festivities[ $key ]->liturgical_season = LitSeason::ORDINARY_TIME;
}
}
}

/**
Expand Down Expand Up @@ -715,6 +715,8 @@ private function createVigilMass(string $key, Festivity $festivity, DateTime $Vi
$this->festivities[ $key . "_vigil" ]->is_vigil_mass = true;
$this->festivities[ $key . "_vigil" ]->is_vigil_for = $key;
$this->festivities[ $key . "_vigil" ]->liturgical_year = $this->festivities[ $key ]->liturgical_year;
$this->festivities[ $key . "_vigil" ]->liturgical_season = $this->festivities[ $key ]->liturgical_season;
$this->festivities[ $key . "_vigil" ]->liturgical_season_lcl = $this->festivities[ $key ]->liturgical_season_lcl;
}

/**
Expand Down

0 comments on commit decff89

Please sign in to comment.