Skip to content
Snippets Groups Projects
Unverified Commit 84a61263 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Renamed object to entity and fixed namespacing and comments

parent b063a3f6
Branches
Tags
No related merge requests found
...@@ -18,7 +18,7 @@ namespace tool_cleanupcourses; ...@@ -18,7 +18,7 @@ namespace tool_cleanupcourses;
use tool_cleanupcourses\manager\step_manager; use tool_cleanupcourses\manager\step_manager;
use tool_cleanupcourses\manager\trigger_manager; use tool_cleanupcourses\manager\trigger_manager;
use tool_cleanupcourses\object\step_subplugin; use tool_cleanupcourses\entity\step_subplugin;
use tool_cleanupcourses\table\step_table; use tool_cleanupcourses\table\step_table;
use tool_cleanupcourses\table\trigger_table; use tool_cleanupcourses\table\trigger_table;
......
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
*/ */
namespace tool_cleanupcourses; namespace tool_cleanupcourses;
use tool_cleanupcourses\entity\trigger_subplugin;
use tool_cleanupcourses\manager\trigger_manager;
use tool_cleanupcourses\response\trigger_response;
defined('MOODLE_INTERNAL') || die; defined('MOODLE_INTERNAL') || die;
class cleanup_processor { class cleanup_processor {
...@@ -47,16 +52,15 @@ class cleanup_processor { ...@@ -47,16 +52,15 @@ class cleanup_processor {
$recordset = $this->get_course_recordset(); $recordset = $this->get_course_recordset();
while ($recordset->valid()) { while ($recordset->valid()) {
$course = $recordset->current(); $course = $recordset->current();
/* @var $trigger trigger\base -> Implementation of the subplugin trigger interface */
foreach ($enabledtrigger as $trigger) { foreach ($enabledtrigger as $trigger) {
$response = $triggerclasses[$trigger->name]->check_course($course); $response = $triggerclasses[$trigger->name]->check_course($course);
if ($response == trigger_respone::next()) { if ($response == trigger_response::next()) {
continue; continue;
} }
if ($response == trigger_respone::exclude()) { if ($response == trigger_response::exclude()) {
break; break;
} }
if ($response == trigger_respone::trigger()) { if ($response == trigger_response::trigger()) {
$this->trigger_course($course->id, trigger_subplugin::from_record($trigger)); $this->trigger_course($course->id, trigger_subplugin::from_record($trigger));
break; break;
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_cleanupcourses\object; namespace tool_cleanupcourses\entity;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_cleanupcourses\object; namespace tool_cleanupcourses\entity;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace tool_cleanupcourses\object; namespace tool_cleanupcourses\entity;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
namespace tool_cleanupcourses; namespace tool_cleanupcourses;
use tool_cleanupcourses\object\step_subplugin; use tool_cleanupcourses\entity\step_subplugin;
use tool_cleanupcourses\manager\step_manager; use tool_cleanupcourses\manager\step_manager;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
*/ */
namespace tool_cleanupcourses\manager; namespace tool_cleanupcourses\manager;
use tool_cleanupcourses\object\step_subplugin; use tool_cleanupcourses\entity\step_subplugin;
use tool_cleanupcourses\object\trigger_subplugin; use tool_cleanupcourses\entity\trigger_subplugin;
use tool_cleanupcourses\manager\trigger_manager;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
namespace tool_cleanupcourses\manager; namespace tool_cleanupcourses\manager;
use tool_cleanupcourses\object\trigger_subplugin; use tool_cleanupcourses\entity\trigger_subplugin;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/** /**
* Lang strings for start date delay trigger * Lang strings for dummy step
* *
* @package tool_cleanupcourses_trigger * @package tool_cleanupcourses_step
* @subpackage startdatedelay * @subpackage dummy
* @copyright 2017 Tobias Reischmann WWU * @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
* Interface for the subplugintype step * Interface for the subplugintype step
* It has to be implemented by all subplugins. * It has to be implemented by all subplugins.
* *
* @package tool_cleanupcourses * @package tool_cleanupcourses_step
* @subpackage step * @subpackage dummy
* @copyright 2017 Tobias Reischmann WWU * @copyright 2017 Tobias Reischmann WWU
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/ */
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
*/ */
namespace tool_cleanupcourses\trigger; namespace tool_cleanupcourses\trigger;
use tool_cleanupcourses\response\trigger_respone; use tool_cleanupcourses\response\trigger_response;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
require_once(__DIR__ . '/../lib.php'); require_once(__DIR__ . '/../lib.php');
...@@ -40,10 +40,10 @@ class dummy implements base { ...@@ -40,10 +40,10 @@ class dummy implements base {
/** /**
* Checks the course and returns a repsonse, which tells if the course should be further processed. * Checks the course and returns a repsonse, which tells if the course should be further processed.
* @param $course object to be processed. * @param $course object to be processed.
* @return trigger_respone * @return trigger_response
*/ */
public function check_course($course) { public function check_course($course) {
return trigger_respone::next(); return trigger_response::next();
} }
} }
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
*/ */
namespace tool_cleanupcourses\trigger; namespace tool_cleanupcourses\trigger;
use tool_cleanupcourses\response\trigger_respone; use tool_cleanupcourses\response\trigger_response;
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
...@@ -35,7 +35,7 @@ interface base { ...@@ -35,7 +35,7 @@ interface base {
/** /**
* Checks the course and returns a repsonse, which tells if the course should be further processed. * Checks the course and returns a repsonse, which tells if the course should be further processed.
* @param $course object to be processed. * @param $course object to be processed.
* @return trigger_respone * @return trigger_response
*/ */
public function check_course($course); public function check_course($course);
......
...@@ -39,7 +39,7 @@ class sitecourse implements base { ...@@ -39,7 +39,7 @@ class sitecourse implements base {
/** /**
* Checks the course and returns a repsonse, which tells if the course should be further processed. * Checks the course and returns a repsonse, which tells if the course should be further processed.
* @param $course object to be processed. * @param $course object to be processed.
* @return trigger_respone * @return trigger_response
*/ */
public function check_course($course) { public function check_course($course) {
if ($course->id == SITEID) { if ($course->id == SITEID) {
......
...@@ -40,7 +40,7 @@ class startdatedelay implements base { ...@@ -40,7 +40,7 @@ class startdatedelay implements base {
/** /**
* Checks the course and returns a repsonse, which tells if the course should be further processed. * Checks the course and returns a repsonse, which tells if the course should be further processed.
* @param $course object to be processed. * @param $course object to be processed.
* @return trigger_respone * @return trigger_response
*/ */
public function check_course($course) { public function check_course($course) {
global $CFG; global $CFG;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment