Code Duplication    Length = 24-24 lines in 7 locations

src/cli/Database/Base/Channel.php 1 location

@@ 1359-1382 (lines=24) @@
1356
     * @return int             Count of related Subscription objects.
1357
     * @throws PropelException
1358
     */
1359
    public function countSubscriptions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
1360
    {
1361
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
1362
        if (null === $this->collSubscriptions || null !== $criteria || $partial) {
1363
            if ($this->isNew() && null === $this->collSubscriptions) {
1364
                return 0;
1365
            }
1366
1367
            if ($partial && !$criteria) {
1368
                return count($this->getSubscriptions());
1369
            }
1370
1371
            $query = ChildSubscriptionQuery::create(null, $criteria);
1372
            if ($distinct) {
1373
                $query->distinct();
1374
            }
1375
1376
            return $query
1377
                ->filterByChannel($this)
1378
                ->count($con);
1379
        }
1380
1381
        return count($this->collSubscriptions);
1382
    }
1383
1384
    /**
1385
     * Method called to associate a ChildSubscription object to this object

src/cli/Database/Base/User.php 2 locations

@@ 1419-1442 (lines=24) @@
1416
     * @return int             Count of related Connection objects.
1417
     * @throws PropelException
1418
     */
1419
    public function countConnections(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
1420
    {
1421
        $partial = $this->collConnectionsPartial && !$this->isNew();
1422
        if (null === $this->collConnections || null !== $criteria || $partial) {
1423
            if ($this->isNew() && null === $this->collConnections) {
1424
                return 0;
1425
            }
1426
1427
            if ($partial && !$criteria) {
1428
                return count($this->getConnections());
1429
            }
1430
1431
            $query = ChildConnectionQuery::create(null, $criteria);
1432
            if ($distinct) {
1433
                $query->distinct();
1434
            }
1435
1436
            return $query
1437
                ->filterByUser($this)
1438
                ->count($con);
1439
        }
1440
1441
        return count($this->collConnections);
1442
    }
1443
1444
    /**
1445
     * Method called to associate a ChildConnection object to this object
@@ 1669-1692 (lines=24) @@
1666
     * @return int             Count of related Subscription objects.
1667
     * @throws PropelException
1668
     */
1669
    public function countSubscriptions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
1670
    {
1671
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
1672
        if (null === $this->collSubscriptions || null !== $criteria || $partial) {
1673
            if ($this->isNew() && null === $this->collSubscriptions) {
1674
                return 0;
1675
            }
1676
1677
            if ($partial && !$criteria) {
1678
                return count($this->getSubscriptions());
1679
            }
1680
1681
            $query = ChildSubscriptionQuery::create(null, $criteria);
1682
            if ($distinct) {
1683
                $query->distinct();
1684
            }
1685
1686
            return $query
1687
                ->filterByUser($this)
1688
                ->count($con);
1689
        }
1690
1691
        return count($this->collSubscriptions);
1692
    }
1693
1694
    /**
1695
     * Method called to associate a ChildSubscription object to this object

src/cli/Database/Base/Instance.php 4 locations

@@ 1367-1390 (lines=24) @@
1364
     * @return int             Count of related User objects.
1365
     * @throws PropelException
1366
     */
1367
    public function countUsers(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
1368
    {
1369
        $partial = $this->collUsersPartial && !$this->isNew();
1370
        if (null === $this->collUsers || null !== $criteria || $partial) {
1371
            if ($this->isNew() && null === $this->collUsers) {
1372
                return 0;
1373
            }
1374
1375
            if ($partial && !$criteria) {
1376
                return count($this->getUsers());
1377
            }
1378
1379
            $query = ChildUserQuery::create(null, $criteria);
1380
            if ($distinct) {
1381
                $query->distinct();
1382
            }
1383
1384
            return $query
1385
                ->filterByInstance($this)
1386
                ->count($con);
1387
        }
1388
1389
        return count($this->collUsers);
1390
    }
1391
1392
    /**
1393
     * Method called to associate a ChildUser object to this object
@@ 1592-1615 (lines=24) @@
1589
     * @return int             Count of related Connection objects.
1590
     * @throws PropelException
1591
     */
1592
    public function countConnections(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
1593
    {
1594
        $partial = $this->collConnectionsPartial && !$this->isNew();
1595
        if (null === $this->collConnections || null !== $criteria || $partial) {
1596
            if ($this->isNew() && null === $this->collConnections) {
1597
                return 0;
1598
            }
1599
1600
            if ($partial && !$criteria) {
1601
                return count($this->getConnections());
1602
            }
1603
1604
            $query = ChildConnectionQuery::create(null, $criteria);
1605
            if ($distinct) {
1606
                $query->distinct();
1607
            }
1608
1609
            return $query
1610
                ->filterByInstance($this)
1611
                ->count($con);
1612
        }
1613
1614
        return count($this->collConnections);
1615
    }
1616
1617
    /**
1618
     * Method called to associate a ChildConnection object to this object
@@ 2067-2090 (lines=24) @@
2064
     * @return int             Count of related Channel objects.
2065
     * @throws PropelException
2066
     */
2067
    public function countChannels(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
2068
    {
2069
        $partial = $this->collChannelsPartial && !$this->isNew();
2070
        if (null === $this->collChannels || null !== $criteria || $partial) {
2071
            if ($this->isNew() && null === $this->collChannels) {
2072
                return 0;
2073
            }
2074
2075
            if ($partial && !$criteria) {
2076
                return count($this->getChannels());
2077
            }
2078
2079
            $query = ChildChannelQuery::create(null, $criteria);
2080
            if ($distinct) {
2081
                $query->distinct();
2082
            }
2083
2084
            return $query
2085
                ->filterByInstance($this)
2086
                ->count($con);
2087
        }
2088
2089
        return count($this->collChannels);
2090
    }
2091
2092
    /**
2093
     * Method called to associate a ChildChannel object to this object
@@ 2292-2315 (lines=24) @@
2289
     * @return int             Count of related Subscription objects.
2290
     * @throws PropelException
2291
     */
2292
    public function countSubscriptions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
2293
    {
2294
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
2295
        if (null === $this->collSubscriptions || null !== $criteria || $partial) {
2296
            if ($this->isNew() && null === $this->collSubscriptions) {
2297
                return 0;
2298
            }
2299
2300
            if ($partial && !$criteria) {
2301
                return count($this->getSubscriptions());
2302
            }
2303
2304
            $query = ChildSubscriptionQuery::create(null, $criteria);
2305
            if ($distinct) {
2306
                $query->distinct();
2307
            }
2308
2309
            return $query
2310
                ->filterByInstance($this)
2311
                ->count($con);
2312
        }
2313
2314
        return count($this->collSubscriptions);
2315
    }
2316
2317
    /**
2318
     * Method called to associate a ChildSubscription object to this object