Last active
March 8, 2018 17:20
-
-
Save piiskop/f85f0c1660df723d224114131a167c63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace pupils; | |
class StudyGroupController { | |
public function __construct($arguments) { | |
require_once dirname(__FILE__) . '/StudyGroup.php'; | |
$data = StudyGroup::findAll(); | |
if (sizeof($data) > 0) { | |
new \o\Response(array ( | |
'data' => $data, | |
'message' => 'number of study groups found: ' . 3, | |
'status' => 200 | |
)); | |
} else { | |
new \o\Response(array ( | |
'message' => 'no study groups found', | |
'status' => 204 | |
)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment