Skip to content

Commit

Permalink
add Roman Missal metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed May 1, 2022
1 parent 5b5eb03 commit 715c28a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions LitCalAllFestivities.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
$key = $festivity[ "TAG" ];
$FestivityCollection[ $key ] = $festivity;
$FestivityCollection[ $key ][ "NAME" ] = $NAME[ $key ];
$FestivityCollection[ $key ][ "MISSAL" ] = $LatinMissal;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion LitCalMetadata.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

include_once( 'includes/enums/RomanMissal.php' );

$requestHeaders = getallheaders();
if( isset( $requestHeaders[ "Origin" ] ) ) {
header( "Access-Control-Allow-Origin: {$requestHeaders[ "Origin" ]}" );
Expand Down Expand Up @@ -58,7 +60,8 @@
"NationalCalendars" => $nationalCalendars,
"DiocesanCalendars" => $diocesanCalendars,
"DiocesanGroups" => $diocesanGroups,
"WiderRegions" => $widerRegionsNames
"WiderRegions" => $widerRegionsNames,
"RomanMissals" => RomanMissal::produceMetadata()
],
], JSON_PRETTY_PRINT );
$responseHash = md5( $response );
Expand Down
7 changes: 7 additions & 0 deletions includes/enums/RomanMissal.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,11 @@ public static function getYearLimits( $value ) : object {
return (object) self::$yearLimits[ $value ];
}

public static function produceMetadata() : array {
$reflectionClass = new ReflectionClass(static::class);
$metadata = $reflectionClass->getConstants();
array_walk($metadata, function(string &$v){ $v = [ "value" => $v, "name" => self::getName( $v ), "sanctoraleFileName" => self::getSanctoraleFileName( $v ), "yearLimits" => self::$yearLimits[ $v ] ]; });
return $metadata;
}

}
12 changes: 6 additions & 6 deletions nations/Europe.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"Festivity": {
"tag": "StBenedict",
"color": "white",
"color": ["white"],
"grade": 4,
"day": 11,
"month": 7
Expand All @@ -22,7 +22,7 @@
{
"Festivity": {
"tag": "StsCyrilMethodius",
"color": "white",
"color": ["white"],
"grade": 4,
"day": 14,
"month": 2
Expand All @@ -42,7 +42,7 @@
{
"Festivity": {
"tag": "StBridget",
"color": "white",
"color": ["white"],
"grade": 4,
"day": 23,
"month": 7
Expand All @@ -65,7 +65,7 @@
{
"Festivity": {
"tag": "StCatherineSiena",
"color": "white",
"color": ["white"],
"grade": 4,
"day": 29,
"month": 4
Expand All @@ -88,7 +88,7 @@
{
"Festivity": {
"tag": "StEdithStein",
"color": "white",
"color": ["red","white"],
"grade": 4,
"day": 9,
"month": 8,
Expand Down Expand Up @@ -120,7 +120,7 @@
{
"Festivity": {
"tag": "StEdithStein",
"color": "white",
"color": ["red","white"],
"grade": 4,
"day": 9,
"month": 8
Expand Down

0 comments on commit 715c28a

Please sign in to comment.