Code Duplication    Length = 14-15 lines in 2 locations

core/db_classes/EE_Datetime.class.php 1 location

@@ 1305-1319 (lines=15) @@
1302
     * @throws InvalidDataTypeException
1303
     * @throws EE_Error
1304
     */
1305
    public function update_sold()
1306
    {
1307
        $count_regs_for_this_datetime = EEM_Registration::instance()->count(
1308
            array(
1309
                array(
1310
                    'STS_ID'                 => EEM_Registration::status_id_approved,
1311
                    'REG_deleted'            => 0,
1312
                    'Ticket.Datetime.DTT_ID' => $this->ID(),
1313
                ),
1314
            )
1315
        );
1316
        $this->set_sold($count_regs_for_this_datetime);
1317
        $this->save();
1318
        return $count_regs_for_this_datetime;
1319
    }
1320
1321
1322
    /*******************************************************************

core/db_classes/EE_Ticket.class.php 1 location

@@ 1563-1576 (lines=14) @@
1560
     * @throws EE_Error
1561
     * @throws ReflectionException
1562
     */
1563
    public function update_tickets_sold()
1564
    {
1565
        $count_regs_for_this_ticket = $this->count_registrations(
1566
            [
1567
                [
1568
                    'STS_ID'      => EEM_Registration::status_id_approved,
1569
                    'REG_deleted' => 0,
1570
                ],
1571
            ]
1572
        );
1573
        $this->set_sold($count_regs_for_this_ticket);
1574
        $this->save();
1575
        return $count_regs_for_this_ticket;
1576
    }
1577
1578
1579
    /**