MDL-58087 core_calendar: Remove redundant event vault factory
Part of MDL-55611 epic.
This commit is contained in:
committed by
Dan Poltawski
parent
59a601e632
commit
b6d9b701f0
@@ -31,9 +31,9 @@ namespace core_calendar\local\event;
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use core_calendar\action_factory;
|
||||
use core_calendar\local\event\data_access\event_vault;
|
||||
use core_calendar\local\event\factories\action_event_factory;
|
||||
use core_calendar\local\event\factories\event_factory;
|
||||
use core_calendar\local\event\factories\event_vault_factory;
|
||||
use core_calendar\local\event\mappers\event_mapper;
|
||||
use core_calendar\local\interfaces\action_event_interface;
|
||||
use core_calendar\local\interfaces\event_interface;
|
||||
@@ -147,8 +147,7 @@ class core_container {
|
||||
}
|
||||
|
||||
if (empty(self::$eventvault)) {
|
||||
$vaultfactory = new event_vault_factory();
|
||||
self::$eventvault = $vaultfactory->create_instance(self::$eventfactory);
|
||||
self::$eventvault = new event_vault(self::$eventfactory, self::$eventretrievalstrategy);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Event vault factory class
|
||||
*
|
||||
* @package core_calendar
|
||||
* @copyright 2017 Ryan Wyllie <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_calendar\local\event\factories;
|
||||
|
||||
use core_calendar\local\event\data_access\event_vault;
|
||||
use core_calendar\local\interfaces\event_factory_interface;
|
||||
use core_calendar\local\interfaces\event_vault_factory_interface;
|
||||
|
||||
/**
|
||||
* Event vault factory class
|
||||
*
|
||||
* @copyright 2017 Ryan Wyllie <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class event_vault_factory implements event_vault_factory_interface {
|
||||
/**
|
||||
* Creates an instance of an event vault
|
||||
*
|
||||
* @param event_factory_interface $eventfactory The event factory
|
||||
* @return event_vault_interface
|
||||
*/
|
||||
public function create_instance(event_factory_interface $eventfactory) {
|
||||
return new event_vault($eventfactory);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Event vault factory interface
|
||||
*
|
||||
* @package core_calendar
|
||||
* @copyright 2017 Ryan Wyllie <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_calendar\local\interfaces;
|
||||
|
||||
/**
|
||||
* Interface for an event vault factory class
|
||||
*
|
||||
* @copyright 2017 Ryan Wyllie <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
interface event_vault_factory_interface {
|
||||
/**
|
||||
* Creates an instance of an event vault
|
||||
*
|
||||
* @param event_factory_interface $eventfactory The event factory
|
||||
* @return event_vault_interface
|
||||
*/
|
||||
public function create_instance(event_factory_interface $eventfactory);
|
||||
}
|
||||
Reference in New Issue
Block a user