Skip to content

Commit 426cfc4

Browse files
committed
add recipe structure
1 parent 192bdd5 commit 426cfc4

5 files changed

Lines changed: 54 additions & 3 deletions

File tree

src/Recipe/Recipe.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99

1010
class Recipe
1111
{
12-
/** @var Step[] */
13-
protected array $steps;
14-
protected string $description;
1512
protected ?string $title;
13+
protected string $description;
1614
protected ?DateInterval $preparationTime;
1715
protected ?DateInterval $cookingTime;
1816
/** @var IngredientAmount[] */
1917
protected array $ingredientAmount;
18+
/** @var RecipePartial[] */
19+
protected array $partials;
20+
21+
/** @var RecipeCategory[] */
22+
protected array $recipeCategories;
2023

2124
}

src/Recipe/RecipeCategory.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
namespace OrdbModels\Recipe;
5+
6+
7+
class RecipeCategory
8+
{
9+
protected string $name;
10+
/** @var Recipe[] */
11+
protected array $recipePartials;
12+
}

src/Recipe/RecipePartial.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
4+
namespace OrdbModels\Recipe;
5+
6+
7+
use DateInterval;
8+
use OrdbModels\Ingredient\IngredientAmount;
9+
10+
class RecipePartial
11+
{
12+
/** @var Step[] */
13+
protected array $steps;
14+
protected string $description;
15+
protected ?string $type = null;
16+
protected ?DateInterval $preparationTime;
17+
protected ?DateInterval $cookingTime;
18+
/** @var IngredientAmount[] */
19+
protected array $ingredientAmount;
20+
/** @var RecipePartialCategory[] */
21+
protected array $recipePartialCategories;
22+
23+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
4+
namespace OrdbModels\Recipe;
5+
6+
7+
class RecipePartialCategory
8+
{
9+
protected string $name;
10+
/** @var RecipePartial[] */
11+
protected array $recipePartials;
12+
}

src/Recipe/Step.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ class Step
1515
protected ?DateInterval $cookingTime;
1616
/** @var IngredientAmount[] */
1717
protected array $ingredientAmount;
18+
protected string $languageIdentifierISO;
1819
}

0 commit comments

Comments
 (0)