Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Contains class for displaying a issuer.
-
 
19
 *
-
 
20
 * @package   core_badges
-
 
21
 * @copyright 2019 Damyon Wiese
-
 
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
23
 */
-
 
24
 
16
 
Línea 25... Línea 17...
25
namespace core_badges\external;
17
namespace core_badges\external;
Línea 26... Línea 18...
26
 
18
 
Línea 36... Línea 28...
36
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37
 */
29
 */
38
class issuer_exporter extends exporter {
30
class issuer_exporter extends exporter {
Línea 39... Línea 31...
39
 
31
 
40
    /**
32
    /**
41
     * Either map version 1 data to version 2 or return it untouched.
33
     * Map data depending on the version.
42
     *
34
     *
43
     * @param stdClass $data The remote data.
35
     * @param \stdClass $data The remote data.
44
     * @param string $apiversion The backpack version used to communicate remotely.
36
     * @param string $apiversion The backpack version used to communicate remotely.
45
     * @return stdClass
37
     * @return \stdClass
46
     */
38
     */
47
    public static function map_external_data($data, $apiversion) {
-
 
48
        if ($apiversion == OPEN_BADGES_V1) {
-
 
49
            $result = new \stdClass();
-
 
50
            return $result;
-
 
51
        }
39
    public static function map_external_data($data, $apiversion) {
52
        $mapped = new \stdClass();
40
        $mapped = new \stdClass();
53
        if (isset($data->entityType)) {
41
        if (isset($data->entityType)) {
54
            $mapped->type = $data->entityType;
42
            $mapped->type = $data->entityType;
55
        } else {
43
        } else {