Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
gredu_labs
Commits
102baa54
Commit
102baa54
authored
Feb 18, 2016
by
Georgios Tsakalos
Browse files
update lab service interface and implement methods
parent
777b891d
Changes
2
Hide whitespace changes
Inline
Side-by-side
module/schools/src/Service/LabService.php
View file @
102baa54
...
...
@@ -70,4 +70,24 @@ class LabService implements LabServiceInterface
return
array_map
([
$this
,
'export'
],
$labs
);
}
public
function
getCourses
(){
$courses
=
R
::
findAll
(
'course'
);
return
$courses
;
}
public
function
getCoursesByLabId
(
$id
){
$lab
=
R
::
load
(
'lab'
,
$id
);
$courses
=
$lab
->
sharedCourse
;
return
$courses
;
}
private
function
getCoursesById
(
array
$ids
){
$courses
=
[];
foreach
(
$ids
as
$id
){
$course
=
R
::
load
(
'course'
,
$id
);
$courses
[]
=
$course
;
}
return
$courses
;
}
}
module/schools/src/Service/LabServiceInterface.php
View file @
102baa54
...
...
@@ -15,4 +15,7 @@ interface LabServiceInterface
public
function
updateLab
(
array
$data
,
$id
);
public
function
getLabById
(
$id
);
public
function
getLabsBySchoolId
(
$id
);
public
function
getCourses
();
public
function
getCoursesByLabId
(
$id
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment