Skip to content

Commit

Permalink
Merge pull request #48 from muskie9/2024_01_14_linkField
Browse files Browse the repository at this point in the history
UPDATE remove silverstripe/linkfield as a dependency
  • Loading branch information
muskie9 authored Jan 21, 2025
2 parents 9cd017b + 67d01de commit e9f0592
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 20 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"CMS"
],
"require": {
"silverstripe/linkfield": "^3.0",
"silverstripe/lumberjack": "^3.0",
"silverstripe/recipe-cms": "^5.0",
"symbiote/silverstripe-gridfieldextensions": "^4.0"
Expand Down
7 changes: 7 additions & 0 deletions src/Controller/RecipeCategoryPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
use SilverStripe\Control\HTTPRequest;
use SilverStripe\ORM\PaginatedList;

/**
* Class \Dynamic\RecipeBook\Page\RecipeCategoryPageController
*
* @property \Dynamic\RecipeBook\Page\RecipeCategoryPage $dataRecord
* @method \Dynamic\RecipeBook\Page\RecipeCategoryPage data()
* @mixin \Dynamic\RecipeBook\Page\RecipeCategoryPage
*/
class RecipeCategoryPageController extends \PageController
{
/**
Expand Down
7 changes: 7 additions & 0 deletions src/Controller/RecipeLandingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
use SilverStripe\Control\HTTPRequest;
use SilverStripe\ORM\PaginatedList;

/**
* Class \Dynamic\RecipeBook\Page\RecipeLandingController
*
* @property \Dynamic\RecipeBook\Page\RecipeLanding $dataRecord
* @method \Dynamic\RecipeBook\Page\RecipeLanding data()
* @mixin \Dynamic\RecipeBook\Page\RecipeLanding
*/
class RecipeLandingController extends \PageController
{
/**
Expand Down
5 changes: 4 additions & 1 deletion src/Controller/RecipePageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

/**
* Class RecipePageController
* @package Dynamic\RecipeBook\Page
*
* @property \Dynamic\RecipeBook\Page\RecipePage $dataRecord
* @method \Dynamic\RecipeBook\Page\RecipePage data()
* @mixin \Dynamic\RecipeBook\Page\RecipePage
*/
class RecipePageController extends \PageController
{
Expand Down
3 changes: 1 addition & 2 deletions src/Model/RecipeDirection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

/**
* Class RecipeDirection
* @package Dynamic\RecipeBook\Page
*
* @property string $Title
* @property int $Sort
* @property int $RecipeID
* @method RecipePage Recipe()
* @method \Dynamic\RecipeBook\Page\RecipePage Recipe()
*/
class RecipeDirection extends DataObject
{
Expand Down
5 changes: 2 additions & 3 deletions src/Model/RecipeIngredient.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@

/**
* Class RecipeIngredient
* @package Dynamic\Nucu\Model
*
* @property string $Title
* @property int $Sort
* @property int $RecipeID
* @method RecipePage Recipe()
* @method \Dynamic\RecipeBook\Page\RecipePage Recipe()
*/
class RecipeIngredient extends DataObject
{
Expand All @@ -26,7 +25,7 @@ class RecipeIngredient extends DataObject
/**
* @var string
*/
private static $plural_name = 'Recipe Ingredients';
private static string $plural_name = 'Recipe Ingredients';

/**
* @var string
Expand Down
6 changes: 6 additions & 0 deletions src/Page/RecipeCategoryPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DB;

/**
* Class \Dynamic\RecipeBook\Page\RecipeCategoryPage
*
* @property int $RecipesPerPage
* @method \SilverStripe\ORM\ManyManyList|\Dynamic\RecipeBook\Page\RecipePage[] Recipes()
*/
class RecipeCategoryPage extends \Page
{
/**
Expand Down
6 changes: 6 additions & 0 deletions src/Page/RecipeLanding.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
use Symbiote\GridFieldExtensions\GridFieldAddExistingSearchButton;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;

/**
* Class \Dynamic\RecipeBook\Page\RecipeLanding
*
* @property int $PerPage
* @method \SilverStripe\ORM\ManyManyList|\Dynamic\RecipeBook\Page\RecipeCategoryPage[] FeaturedCategories()
*/
class RecipeLanding extends \Page
{
/**
Expand Down
35 changes: 22 additions & 13 deletions src/Page/RecipePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@

/**
* Class RecipePage
* @package Dynamic\RecipeBook\Page
*
* @property int $Servings
* @property string $Servings
* @property string $PrepTime
* @property string $CookTime
* @property string $Difficulty
* @method HasManyList Ingredients()
* @method HasManyList Directions()
* @method ManyManyList Categories()
* @property int $ImageID
* @method \SilverStripe\Assets\Image Image()
* @method \SilverStripe\ORM\DataList|\Dynamic\RecipeBook\Model\RecipeIngredient[] Ingredients()
* @method \SilverStripe\ORM\DataList|\Dynamic\RecipeBook\Model\RecipeDirection[] Directions()
* @method \SilverStripe\ORM\ManyManyList|\Dynamic\RecipeBook\Page\RecipeCategoryPage[] Categories()
*/
class RecipePage extends \Page
{
Expand Down Expand Up @@ -78,7 +79,7 @@ class RecipePage extends \Page
* @var array
* @config
*/
private static $has_one = [
private static array $has_one = [
'Image' => Image::class,
];

Expand Down Expand Up @@ -113,20 +114,28 @@ class RecipePage extends \Page
* @var string[]
* @config
*/
private static $owns = [
private static array $owns = [
'Image',
];

/**
* @var array
* @config
*/
private static $cascade_duplicates = [
private static array $cascade_duplicates = [
'Image',
'Ingredients',
'Directions',
];

/**
* @var array|string[]
*/
private static array $cascade_deletes = [
'Ingredients',
'Directions',
];

/**
* @var array
* @config
Expand Down Expand Up @@ -248,12 +257,12 @@ public function getCMSFields(): FieldList
->addComponent(GridFieldDeleteAction::create())
->addComponent(GridFieldAddNewInlineButton::create());

$directionsConfig->getComponentByType(GridFieldEditableColumns::class)->setDisplayFields(array(
'Title' => array(
$directionsConfig->getComponentByType(GridFieldEditableColumns::class)->setDisplayFields([
'Title' => [
'title' => 'Title',
'field' => TextField::class
),
));
'field' => TextField::class,
],
]);

$catConfig
->removeComponentsByType([
Expand Down

0 comments on commit e9f0592

Please sign in to comment.