Example #1
0
 /**
  * Create new instance of leave
  *
  * @param \Opit\OpitHrm\LeaveBundle\Entity\Leave $leave
  * @param \Opit\OpitHrm\LeaveBundle\Entity\LeaveRequest $leaveRequest
  * @param \Opit\OpitHrm\LeaveBundle\Entity\LeaveCategory $leaveCategory
  * @param integer $leaveLength
  * @return \Opit\OpitHrm\LeaveBundle\Entity\Leave
  */
 public function createLeaveInstance(Leave $leave, LeaveRequest $leaveRequest, LeaveCategory $leaveCategory, $leaveLength, $startDate, $endDate)
 {
     $l = new Leave();
     $l->setDescription($leave->getDescription());
     $l->setStartDate($startDate);
     $l->setEndDate($endDate);
     $l->setLeaveRequest($leaveRequest);
     $l->setNumberOfDays($leaveLength);
     $l->setCategory($leaveCategory);
     return $l;
 }
Example #2
0
 /**
  * Add leaves
  *
  * @param \Opit\OpitHrm\LeaveBundle\Entity\Leave $leaves
  * @return LeaveRequest
  */
 public function addLeaf(\Opit\OpitHrm\LeaveBundle\Entity\Leave $leaves)
 {
     $this->leaves[] = $leaves;
     $leaves->setLeaveRequest($this);
     // synchronously updating inverse side
     return $this;
 }