<?php
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!*/
class Mentor
{
//------------------------
// MEMBER VARIABLES
//------------------------
//Mentor Attributes
private $name;
private $id;
//Mentor Associations
private $student;
//------------------------
// CONSTRUCTOR
//------------------------
public function __construct($aName = null, $aStudent = null)
{
if (func_num_args() == 0) { return; }
$this->name = $aName;
$this->id = NULL;
if ($aStudent == null || $aStudent->getMentor() != null)
{
throw new Exception("Unable to create Mentor due to aStudent. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
$this->student = $aStudent;
}
public static function newInstance($aName, $aNameForStudent, $aNumberForStudent)
{
$thisInstance = new Mentor();
$thisInstance->name = $aName;
$thisInstance->id = NULL;
$thisInstance->student = new Student($aNameForStudent, $aNumberForStudent, $thisInstance);
return $thisInstance;
}
//------------------------
// INTERFACE
//------------------------
public function setName($aName)
{
$wasSet = false;
$this->name = $aName;
$wasSet = true;
return $wasSet;
}
public function setId($aId)
{
$wasSet = false;
$this->id = $aId;
$wasSet = true;
return $wasSet;
}
public function getName()
{
return $this->name;
}
public function getId()
{
return $this->id;
}
public function getStudent()
{
return $this->student;
}
public function equals($compareTo)
{
return $this == $compareTo;
}
public function delete()
{
$existingStudent = $this->student;
$this->student = null;
if ($existingStudent != null)
{
$existingStudent->delete();
}
}
}
?>
<?php
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!*/
class Student
{
//------------------------
// MEMBER VARIABLES
//------------------------
//Student Attributes
private $name;
private $number;
//Student Associations
private $mentor;
//------------------------
// CONSTRUCTOR
//------------------------
public function __construct($aName = null, $aNumber = null, $aMentor = null)
{
if (func_num_args() == 0) { return; }
$this->name = $aName;
$this->number = $aNumber;
if ($aMentor == null || $aMentor->getStudent() != null)
{
throw new Exception("Unable to create Student due to aMentor. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
}
$this->mentor = $aMentor;
}
public static function newInstance($aName, $aNumber, $aNameForMentor)
{
$thisInstance = new Student();
$thisInstance->name = $aName;
$thisInstance->number = $aNumber;
$thisInstance->mentor = new Mentor($aNameForMentor, $thisInstance);
return $thisInstance;
}
//------------------------
// INTERFACE
//------------------------
public function setName($aName)
{
$wasSet = false;
$this->name = $aName;
$wasSet = true;
return $wasSet;
}
public function setNumber($aNumber)
{
$wasSet = false;
$this->number = $aNumber;
$wasSet = true;
return $wasSet;
}
public function getName()
{
return $this->name;
}
public function getNumber()
{
return $this->number;
}
public function getMentor()
{
return $this->mentor;
}
public function equals($compareTo)
{
return $this == $compareTo;
}
public function delete()
{
$existingMentor = $this->mentor;
$this->mentor = null;
if ($existingMentor != null)
{
$existingMentor->delete();
}
}
}
?>