Skip to content
Snippets Groups Projects
Commit e4987ba3 authored by xamgore's avatar xamgore Committed by PavelBegunkov
Browse files

Define access modifier for functions

parent 10a71e3b
Branches
Tags
No related merge requests found
......@@ -20,49 +20,49 @@ class Model_Helper_StudentBuilder extends Model_Helper_Builder
return new Model_Student($this->data, false);
}
function & lastName($string) {
public function & lastName($string) {
$string = trim($string); # todo: remove empty symbols
if (!strlen($string))
if (!$string)
throw new InvalidArgumentException('Last name can\'t be empty');
$this->data['LastName'] = $string;
return $this;
}
function & firstName($string) {
public function & firstName($string) {
$string = trim($string);
if (!strlen($string))
if (!$string)
throw new InvalidArgumentException('First name can\'t be empty');
$this->data['FirstName'] = $string;
return $this;
}
function & secondName($string) {
public function & secondName($string) {
$this->data['SecondName'] = trim($string);
return $this;
}
function & grade($id) {
public function & grade($id) {
if (!is_numeric($id) || $id <= 0)
throw new InvalidArgumentException('Grade id is incorrect');
$this->data['GradeID'] = (int) $id;
return $this;
}
function & group($num) {
public function & group($num) {
if (!is_numeric($num) || $num <= 0)
throw new InvalidArgumentException('GroupNum id is incorrect');
$this->data['GroupNum'] = (int) $num;
return $this;
}
function & faculty($id) {
public function & faculty($id) {
if (!is_numeric($id) || $id <= 0)
throw new InvalidArgumentException('Faculty id is incorrect');
$this->data['FacultyID'] = (int) $id;
return $this;
}
function & semester($id) {
public function & semester($id) {
if (!is_numeric($id) || $id <= 0)
throw new InvalidArgumentException('Semester id is incorrect');
$this->data['SemesterID'] = (int) $id;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment