Skip to content

Instantly share code, notes, and snippets.

@piiskop
Last active March 8, 2018 17:20
Show Gist options
  • Save piiskop/f85f0c1660df723d224114131a167c63 to your computer and use it in GitHub Desktop.
Save piiskop/f85f0c1660df723d224114131a167c63 to your computer and use it in GitHub Desktop.
<?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