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
Σταύρος Παπαδάκης
gredu_labs
Commits
16f12163
Commit
16f12163
authored
Feb 11, 2016
by
Georgios Tsakalos
Browse files
change school and lab field names
parent
ee933d95
Changes
2
Hide whitespace changes
Inline
Side-by-side
module/schools/src/Service/LabService.php
View file @
16f12163
...
...
@@ -27,7 +27,8 @@ class LabService implements LabServiceInterface
public
function
createLab
(
array
$data
)
{
$lab
=
R
::
dispense
(
'lab'
);
$required
=
[
'name'
,
'school_id'
,
'area'
];
$required
=
[
'school_id'
,
'name'
,
'type'
,
'area'
,
'in_school_use'
,
'out_school_use'
,
'courses'
,
'attachment'
,
'has_network'
,
'has_server'
];
foreach
(
$required
as
$value
){
if
(
array_key_exists
(
$value
,
$data
)){
$lab
[
$value
]
=
$data
[
$value
];
...
...
module/schools/src/Service/SchoolService.php
View file @
16f12163
...
...
@@ -16,8 +16,9 @@ class SchoolService implements SchoolServiceInterface
public
function
createSchool
(
array
$data
)
{
$school
=
R
::
dispense
(
'school'
);
$required
=
[
'registryNo'
,
'educationLevel'
,
'unitType'
,
'category'
,
'eduAdmin'
,
'regionEduAdmin'
];
$optional
=
[
'streetAddress'
,
'phoneNumber'
,
'faxNumber'
,
'email'
];
$required
=
[
'registry_no'
,
'name'
,
'municipality'
,
'schooltype_id'
,
'prefecture_id'
,
'educationlevel_id'
,
'eduadmin_id'
,
'created'
,
'creator'
];
$optional
=
[
'street_address'
,
'postal_code'
,
'phone_number'
,
'fax_number'
,
'email'
];
foreach
(
$required
as
$value
)
{
if
(
array_key_exists
(
$value
,
$data
))
{
$school
[
$value
]
=
$data
[
$value
];
...
...
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