Code Duplication    Length = 6-9 lines in 2 locations

core/db_classes/EE_Line_Item.class.php 2 locations

@@ 624-632 (lines=9) @@
621
     */
622
    public function get_ticket_datetime()
623
    {
624
        if ($this->OBJ_type() === 'Ticket') {
625
            $ticket = $this->ticket();
626
            if ($ticket instanceof EE_Ticket) {
627
                $datetime = $ticket->first_datetime();
628
                if ($datetime instanceof EE_Datetime) {
629
                    return $datetime;
630
                }
631
            }
632
        }
633
        return null;
634
    }
635
@@ 666-671 (lines=6) @@
663
    {
664
        $event = null;
665
        $ticket = $this->ticket();
666
        if ($ticket instanceof EE_Ticket) {
667
            $datetime = $ticket->first_datetime();
668
            if ($datetime instanceof EE_Datetime) {
669
                $event = $datetime->event();
670
            }
671
        }
672
        return $event;
673
    }
674