summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-19 23:57:43 +0200
committerSimon Rettberg2017-04-19 23:57:43 +0200
commitdf2518c0d6dde4fa621f880e098f9ce56067817d (patch)
tree8c622a196ce9fba1bb40e6e0b82add4825989e43 /modules-available/locationinfo/inc/coursebackend.inc.php
parent[locationinfo] Return untranslated tag of backend property if missing (diff)
downloadslx-admin-df2518c0d6dde4fa621f880e098f9ce56067817d.tar.gz
slx-admin-df2518c0d6dde4fa621f880e098f9ce56067817d.tar.xz
slx-admin-df2518c0d6dde4fa621f880e098f9ce56067817d.zip
[locationinfo] CourseBackend: Rename some methods to be more descriptive
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend.inc.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend.inc.php b/modules-available/locationinfo/inc/coursebackend.inc.php
index 0d84b0fb..0ce9424d 100644
--- a/modules-available/locationinfo/inc/coursebackend.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend.inc.php
@@ -94,7 +94,7 @@ abstract class CourseBackend
/**
* @returns \BackendProperty[] list of properties that need to be set
*/
- public abstract function getCredentials();
+ public abstract function getCredentialDefinitions();
/**
* @return boolean true if the connection works, false otherwise
@@ -210,7 +210,7 @@ abstract class CourseBackend
public final function setCredentials($serverId, $data)
{
- foreach ($this->getCredentials() as $prop) {
+ foreach ($this->getCredentialDefinitions() as $prop) {
if (!isset($data[$prop->property])) {
$data[$prop->property] = $prop->default;
}
@@ -242,7 +242,7 @@ abstract class CourseBackend
* and leaf nodes. The result is always an array on success, or
* false if not found.
*/
- protected function getAttributes($array, $path)
+ protected function getArrayPath($array, $path)
{
if (!is_array($path)) {
// Convert 'path/syntax/foo/wanteditem' to array for further processing and recursive calls
@@ -279,7 +279,7 @@ abstract class CourseBackend
// wrapped in a plain array - recurse into each one of them and merge the results
$return = [];
foreach ($array[$element] as $item) {
- $test = $this->getAttributes($item, $path);
+ $test = $this->getArrayPath($item, $path);
If (gettype($test) == "array") {
$return = array_merge($return, $test);
}
@@ -288,14 +288,14 @@ abstract class CourseBackend
return $return;
}
// Unique non-leaf node - simple recursion
- return $this->getAttributes($array[$element], $path);
+ return $this->getArrayPath($array[$element], $path);
}
/**
* @param string $response xml document to convert
* @return bool|array array representation of the xml if possible, false otherwise
*/
- protected function toArray($response)
+ protected function xmlStringToArray($response)
{
$cleanresponse = preg_replace('/(<\/?)(\w+):([^>]*>)/', '$1$2$3', $response);
try {