Code Duplication    Length = 6-9 lines in 2 locations

core/db_classes/EE_Line_Item.class.php 2 locations

@@ 509-517 (lines=9) @@
506
	 * @return EE_Datetime | NULL
507
	 */
508
	public function get_ticket_datetime() {
509
		if ( $this->OBJ_type() === 'Ticket' ) {
510
			$ticket = $this->ticket();
511
			if ( $ticket instanceof EE_Ticket ) {
512
				$datetime = $ticket->first_datetime();
513
				if ( $datetime instanceof EE_Datetime ) {
514
					return $datetime;
515
				}
516
			}
517
		}
518
		return NULL;
519
	}
520
@@ 545-550 (lines=6) @@
542
	public function ticket_event() {
543
		$event = null;
544
		$ticket = $this->ticket();
545
		if ( $ticket instanceof EE_Ticket ) {
546
			$datetime = $ticket->first_datetime();
547
			if ( $datetime instanceof EE_Datetime ) {
548
				$event = $datetime->event();
549
			}
550
		}
551
		return $event;
552
	}
553