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
86aa0aeb
Commit
86aa0aeb
authored
Feb 23, 2016
by
Georgios Tsakalos
Browse files
fix bugs in software service
parent
771a9617
Changes
2
Hide whitespace changes
Inline
Side-by-side
module/schools/src/Service/SoftwareService.php
View file @
86aa0aeb
...
...
@@ -31,7 +31,7 @@ class SoftwareService implements SoftwareServiceInterface
public
function
getSoftwareCategories
()
{
$software_categories
=
R
::
findAll
(
'softwarecategory'
);
return
$software_categories
;
return
$this
->
exportAll
(
$software_categories
)
;
}
public
function
updateSoftwareCategory
(
$id
,
$data
)
...
...
@@ -80,7 +80,7 @@ class SoftwareService implements SoftwareServiceInterface
public
function
getSoftwareBySchoolId
(
$id
)
{
$software
=
R
::
findAll
(
'software'
,
'school_id = ?'
,
[
$id
]);
return
$
software
->
exportAll
();
return
$
this
->
exportAll
(
$software
);
}
public
function
getSoftwareByLabId
(
$id
)
...
...
@@ -88,4 +88,14 @@ class SoftwareService implements SoftwareServiceInterface
$software
=
R
::
findAll
(
'software'
,
'lab_id = ?'
,
[
$id
]);
return
$software
->
exportAll
();
}
private
function
exportAll
(
$beans
)
{
$exported
=
[];
foreach
(
$beans
as
$bean
)
{
$exported
[]
=
$bean
->
export
();
}
return
$exported
;
}
}
module/schools/src/Service/SoftwareServiceInterface.php
View file @
86aa0aeb
...
...
@@ -13,7 +13,7 @@ interface SoftwareServiceInterface
{
public
function
createSoftwareCategory
(
$name
);
public
function
getSoftwareCategoryById
(
$id
);
public
function
getSoftwareCa
g
egories
();
public
function
getSoftwareCa
t
egories
();
public
function
updateSoftwareCategory
(
$id
,
$data
);
public
function
createSoftware
(
array
$data
);
public
function
updateSoftware
(
array
$data
,
$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