From 418f9249747fa312fccf771479acdefa4d3f980c Mon Sep 17 00:00:00 2001 From: Nic Horstmeier Date: Fri, 17 May 2019 10:32:54 -0500 Subject: [PATCH] REFACTOR remove SlidePublishTask ping #166 --- src/Task/SlideLinkTask.php | 2 +- src/Task/SlidePublishTask.php | 84 --------------------- src/Task/SlideThumbnailNavMigrationTask.php | 2 +- 3 files changed, 2 insertions(+), 86 deletions(-) delete mode 100644 src/Task/SlidePublishTask.php diff --git a/src/Task/SlideLinkTask.php b/src/Task/SlideLinkTask.php index 5695bed..ed3f7ef 100644 --- a/src/Task/SlideLinkTask.php +++ b/src/Task/SlideLinkTask.php @@ -17,7 +17,7 @@ class SlideLinkTask extends BuildTask /** * @var string */ - protected $title = 'Slide Link Migration Task'; + protected $title = 'Flexslider - Slide Link Migration Task'; /** * @var string diff --git a/src/Task/SlidePublishTask.php b/src/Task/SlidePublishTask.php deleted file mode 100644 index 1036a68..0000000 --- a/src/Task/SlidePublishTask.php +++ /dev/null @@ -1,84 +0,0 @@ -publishSlides(); - } - - /** - * @return \Generator - */ - protected function getSlides() - { - foreach (SlideImage::get() as $slide) { - yield $slide; - } - } - - /** - * mark all ProductDetail records as ShowInMenus = 0. - */ - public function publishSlides() - { - $slides = SlideImage::get(); - $ct = 0; - foreach ($this->getSlides() as $slide) { - if ($slide->ShowSlide == 1) { - if (!$slide->Name) { - $slide->Name = "No Name"; - } - $slide->writeToStage('Stage'); - $slide->publishRecursive(); - ++$ct; - } - } - static::write_message($ct . " SlideImages updated"); - } - - /** - * @param $message - */ - protected static function write_message($message) - { - if (Director::is_cli()) { - echo "{$message}\n"; - } else { - echo "{$message}

"; - } - } -} diff --git a/src/Task/SlideThumbnailNavMigrationTask.php b/src/Task/SlideThumbnailNavMigrationTask.php index 4f4b3d8..b52e74a 100644 --- a/src/Task/SlideThumbnailNavMigrationTask.php +++ b/src/Task/SlideThumbnailNavMigrationTask.php @@ -19,7 +19,7 @@ class SlideThumbnailNavMigrationTask extends BuildTask /** * @var string */ - protected $title = 'FlexSlider Default Values'; + protected $title = 'FlexSlider - Default Values'; /** * @var string