<?php
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.33.0.6934.a386b0a58 modeling language!*/

class Mentor
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Mentor Associations
  private $student;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public function __construct()
  {}

  //------------------------
  // INTERFACE
  //------------------------

  public function getStudent()
  {
    return $this->student;
  }

  public function hasStudent()
  {
    $has = $this->student != null;
    return $has;
  }

  public function setStudent($aNewStudent)
  {
    $wasSet = false;
    if ($aNewStudent == null)
    {
      $existingStudent = $this->student;
      $this->student = null;
      
      if ($existingStudent != null && $existingStudent->getMentor() != null)
      {
        $existingStudent->setMentor(null);
      }
      $wasSet = true;
      return $wasSet;
    }
    
    $currentStudent = $this->getStudent();
    if ($currentStudent != null && $currentStudent != $aNewStudent)
    {
      $currentStudent->setMentor(null);
    }
    
    $this->student = $aNewStudent;
    $existingMentor = $aNewStudent->getMentor();
    
    if ($this != $existingMentor)
    {
      $aNewStudent->setMentor($this);
    }
    $wasSet = true;
    return $wasSet;
  }

  public function equals($compareTo)
  {
    return $this == $compareTo;
  }

  public function delete()
  {
    if ($this->student != null)
    {
      $this->student->setMentor(null);
    }
  }

}
?>
<?php
/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE 1.33.0.6934.a386b0a58 modeling language!*/

class Student
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Student Associations
  private $mentor;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public function __construct()
  {}

  //------------------------
  // INTERFACE
  //------------------------

  public function getMentor()
  {
    return $this->mentor;
  }

  public function hasMentor()
  {
    $has = $this->mentor != null;
    return $has;
  }

  public function setMentor($aNewMentor)
  {
    $wasSet = false;
    if ($aNewMentor == null)
    {
      $existingMentor = $this->mentor;
      $this->mentor = null;
      
      if ($existingMentor != null && $existingMentor->getStudent() != null)
      {
        $existingMentor->setStudent(null);
      }
      $wasSet = true;
      return $wasSet;
    }
    
    $currentMentor = $this->getMentor();
    if ($currentMentor != null && $currentMentor != $aNewMentor)
    {
      $currentMentor->setStudent(null);
    }
    
    $this->mentor = $aNewMentor;
    $existingStudent = $aNewMentor->getStudent();
    
    if ($this != $existingStudent)
    {
      $aNewMentor->setStudent($this);
    }
    $wasSet = true;
    return $wasSet;
  }

  public function equals($compareTo)
  {
    return $this == $compareTo;
  }

  public function delete()
  {
    if ($this->mentor != null)
    {
      $this->mentor->setStudent(null);
    }
  }

}
?>