/** * Creates new ticket time track. * WARNING: Data is not sent to Kayako unless you explicitly call create() on this method's result. * * @param kyTicket $ticket Ticket to attach the timetrack to. * @param string $contents Note contents. * @param kyStaff $staff Staff user - both creator and worker. * @param string $time_worked Worked time formatted as hh:mm. Work date will be set to current datetime. * @param string $time_billable Billable time formatted as hh:mm. Bill date will be set to current datetime. * @return kyTicketTimeTrack */ public static function createNew(kyTicket $ticket, $contents, kyStaff $staff, $time_worked, $time_billable) { $ticket_time_track = new self(); $ticket_time_track->setTicketId($ticket->getId()); $ticket_time_track->setContents($contents); $ticket_time_track->setCreatorStaff($staff); $ticket_time_track->setWorkerStaff($staff); $ticket_time_track->setBillingData($time_billable); $ticket_time_track->setWorkedData($time_worked); return $ticket_time_track; }
private static function create(FingerPrint $fingerPrint, $id, DateTime $date, $email, $totalItems, $totalOrder, $quantityInstallments, $ip, $origin, CustomerBillingData $customerBillingData, CustomerShippingData $shippingData, Payment $payment, Item $item, Passenger $passenger = null, Connection $connection = null, HotelReservation $hotelReservation = null) { $instance = new self(); $instance->setFingerPrint($fingerPrint); $instance->setId($id); $instance->setDate($date); $instance->setEmail($email); $instance->setTotalItems($totalItems); $instance->setTotalOrder($totalOrder); $instance->setQuantityInstallments($quantityInstallments); $instance->setIp($ip); $instance->setOrigin($origin); $instance->setBillingData($customerBillingData); $instance->setShippingData($shippingData); $instance->addPayment($payment); $instance->addItem($item); if (null !== $passenger) { $instance->addPassenger($passenger); } if (null !== $connection) { $instance->addConnection($connection); } if (null !== $hotelReservation) { $instance->addHotelReservation($hotelReservation); } return $instance; }