Skip to content

Instantly share code, notes, and snippets.

@piiskop
Created March 8, 2018 18:00
Show Gist options
  • Save piiskop/25d00af3e2bad85eadfb8f87fb44dcf3 to your computer and use it in GitHub Desktop.
Save piiskop/25d00af3e2bad85eadfb8f87fb44dcf3 to your computer and use it in GitHub Desktop.
<?php
namespace pupils;
class StudyGroup {
private $id;
private $name;
/**
*
* @return mixed
*/
public function getId() {
return $this->id;
}
/**
*
* @return mixed
*/
public function getName() {
return $this->name;
}
/**
*
* @param mixed $id
*/
public function setId($id) {
$this->id = $id;
}
/**
*
* @param mixed $name
*/
public function setName($name) {
$this->name = $name;
}
public function __construct($arguments) {
if (isset($arguments['id'])) {
$this->setId($arguments['id']);
}
if (isset($arguments['name'])) {
$this->setName($arguments['name']);
}
}
public static function findAll() {
$_SESSION['dbEngine']->queryDatabase(
array (
'queryString' => 'SELECT idStudyGroup, name FROM StudyGroup'
));
return $_SESSION['dbEngine']->getRecords();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment