Code Duplication    Length = 43-43 lines in 7 locations

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

@@ 1273-1315 (lines=43) @@
1270
     * @return ObjectCollection|ChildSubscription[] List of ChildSubscription objects
1271
     * @throws PropelException
1272
     */
1273
    public function getSubscriptions(Criteria $criteria = null, ConnectionInterface $con = null)
1274
    {
1275
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
1276
        if (null === $this->collSubscriptions || null !== $criteria  || $partial) {
1277
            if ($this->isNew() && null === $this->collSubscriptions) {
1278
                // return empty collection
1279
                $this->initSubscriptions();
1280
            } else {
1281
                $collSubscriptions = ChildSubscriptionQuery::create(null, $criteria)
1282
                    ->filterByChannel($this)
1283
                    ->find($con);
1284
1285
                if (null !== $criteria) {
1286
                    if (false !== $this->collSubscriptionsPartial && count($collSubscriptions)) {
1287
                        $this->initSubscriptions(false);
1288
1289
                        foreach ($collSubscriptions as $obj) {
1290
                            if (false == $this->collSubscriptions->contains($obj)) {
1291
                                $this->collSubscriptions->append($obj);
1292
                            }
1293
                        }
1294
1295
                        $this->collSubscriptionsPartial = true;
1296
                    }
1297
1298
                    return $collSubscriptions;
1299
                }
1300
1301
                if ($partial && $this->collSubscriptions) {
1302
                    foreach ($this->collSubscriptions as $obj) {
1303
                        if ($obj->isNew()) {
1304
                            $collSubscriptions[] = $obj;
1305
                        }
1306
                    }
1307
                }
1308
1309
                $this->collSubscriptions = $collSubscriptions;
1310
                $this->collSubscriptionsPartial = false;
1311
            }
1312
        }
1313
1314
        return $this->collSubscriptions;
1315
    }
1316
1317
    /**
1318
     * Sets a collection of ChildSubscription objects related by a one-to-many relationship

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

@@ 1223-1265 (lines=43) @@
1220
     * @return ObjectCollection|ChildUser[] List of ChildUser objects
1221
     * @throws PropelException
1222
     */
1223
    public function getUsers(Criteria $criteria = null, ConnectionInterface $con = null)
1224
    {
1225
        $partial = $this->collUsersPartial && !$this->isNew();
1226
        if (null === $this->collUsers || null !== $criteria  || $partial) {
1227
            if ($this->isNew() && null === $this->collUsers) {
1228
                // return empty collection
1229
                $this->initUsers();
1230
            } else {
1231
                $collUsers = ChildUserQuery::create(null, $criteria)
1232
                    ->filterByInstance($this)
1233
                    ->find($con);
1234
1235
                if (null !== $criteria) {
1236
                    if (false !== $this->collUsersPartial && count($collUsers)) {
1237
                        $this->initUsers(false);
1238
1239
                        foreach ($collUsers as $obj) {
1240
                            if (false == $this->collUsers->contains($obj)) {
1241
                                $this->collUsers->append($obj);
1242
                            }
1243
                        }
1244
1245
                        $this->collUsersPartial = true;
1246
                    }
1247
1248
                    return $collUsers;
1249
                }
1250
1251
                if ($partial && $this->collUsers) {
1252
                    foreach ($this->collUsers as $obj) {
1253
                        if ($obj->isNew()) {
1254
                            $collUsers[] = $obj;
1255
                        }
1256
                    }
1257
                }
1258
1259
                $this->collUsers = $collUsers;
1260
                $this->collUsersPartial = false;
1261
            }
1262
        }
1263
1264
        return $this->collUsers;
1265
    }
1266
1267
    /**
1268
     * Sets a collection of ChildUser objects related by a one-to-many relationship
@@ 1448-1490 (lines=43) @@
1445
     * @return ObjectCollection|ChildConnection[] List of ChildConnection objects
1446
     * @throws PropelException
1447
     */
1448
    public function getConnections(Criteria $criteria = null, ConnectionInterface $con = null)
1449
    {
1450
        $partial = $this->collConnectionsPartial && !$this->isNew();
1451
        if (null === $this->collConnections || null !== $criteria  || $partial) {
1452
            if ($this->isNew() && null === $this->collConnections) {
1453
                // return empty collection
1454
                $this->initConnections();
1455
            } else {
1456
                $collConnections = ChildConnectionQuery::create(null, $criteria)
1457
                    ->filterByInstance($this)
1458
                    ->find($con);
1459
1460
                if (null !== $criteria) {
1461
                    if (false !== $this->collConnectionsPartial && count($collConnections)) {
1462
                        $this->initConnections(false);
1463
1464
                        foreach ($collConnections as $obj) {
1465
                            if (false == $this->collConnections->contains($obj)) {
1466
                                $this->collConnections->append($obj);
1467
                            }
1468
                        }
1469
1470
                        $this->collConnectionsPartial = true;
1471
                    }
1472
1473
                    return $collConnections;
1474
                }
1475
1476
                if ($partial && $this->collConnections) {
1477
                    foreach ($this->collConnections as $obj) {
1478
                        if ($obj->isNew()) {
1479
                            $collConnections[] = $obj;
1480
                        }
1481
                    }
1482
                }
1483
1484
                $this->collConnections = $collConnections;
1485
                $this->collConnectionsPartial = false;
1486
            }
1487
        }
1488
1489
        return $this->collConnections;
1490
    }
1491
1492
    /**
1493
     * Sets a collection of ChildConnection objects related by a one-to-many relationship
@@ 1698-1740 (lines=43) @@
1695
     * @return ObjectCollection|ChildChannel[] List of ChildChannel objects
1696
     * @throws PropelException
1697
     */
1698
    public function getChannels(Criteria $criteria = null, ConnectionInterface $con = null)
1699
    {
1700
        $partial = $this->collChannelsPartial && !$this->isNew();
1701
        if (null === $this->collChannels || null !== $criteria  || $partial) {
1702
            if ($this->isNew() && null === $this->collChannels) {
1703
                // return empty collection
1704
                $this->initChannels();
1705
            } else {
1706
                $collChannels = ChildChannelQuery::create(null, $criteria)
1707
                    ->filterByInstance($this)
1708
                    ->find($con);
1709
1710
                if (null !== $criteria) {
1711
                    if (false !== $this->collChannelsPartial && count($collChannels)) {
1712
                        $this->initChannels(false);
1713
1714
                        foreach ($collChannels as $obj) {
1715
                            if (false == $this->collChannels->contains($obj)) {
1716
                                $this->collChannels->append($obj);
1717
                            }
1718
                        }
1719
1720
                        $this->collChannelsPartial = true;
1721
                    }
1722
1723
                    return $collChannels;
1724
                }
1725
1726
                if ($partial && $this->collChannels) {
1727
                    foreach ($this->collChannels as $obj) {
1728
                        if ($obj->isNew()) {
1729
                            $collChannels[] = $obj;
1730
                        }
1731
                    }
1732
                }
1733
1734
                $this->collChannels = $collChannels;
1735
                $this->collChannelsPartial = false;
1736
            }
1737
        }
1738
1739
        return $this->collChannels;
1740
    }
1741
1742
    /**
1743
     * Sets a collection of ChildChannel objects related by a one-to-many relationship
@@ 1923-1965 (lines=43) @@
1920
     * @return ObjectCollection|ChildSubscription[] List of ChildSubscription objects
1921
     * @throws PropelException
1922
     */
1923
    public function getSubscriptions(Criteria $criteria = null, ConnectionInterface $con = null)
1924
    {
1925
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
1926
        if (null === $this->collSubscriptions || null !== $criteria  || $partial) {
1927
            if ($this->isNew() && null === $this->collSubscriptions) {
1928
                // return empty collection
1929
                $this->initSubscriptions();
1930
            } else {
1931
                $collSubscriptions = ChildSubscriptionQuery::create(null, $criteria)
1932
                    ->filterByInstance($this)
1933
                    ->find($con);
1934
1935
                if (null !== $criteria) {
1936
                    if (false !== $this->collSubscriptionsPartial && count($collSubscriptions)) {
1937
                        $this->initSubscriptions(false);
1938
1939
                        foreach ($collSubscriptions as $obj) {
1940
                            if (false == $this->collSubscriptions->contains($obj)) {
1941
                                $this->collSubscriptions->append($obj);
1942
                            }
1943
                        }
1944
1945
                        $this->collSubscriptionsPartial = true;
1946
                    }
1947
1948
                    return $collSubscriptions;
1949
                }
1950
1951
                if ($partial && $this->collSubscriptions) {
1952
                    foreach ($this->collSubscriptions as $obj) {
1953
                        if ($obj->isNew()) {
1954
                            $collSubscriptions[] = $obj;
1955
                        }
1956
                    }
1957
                }
1958
1959
                $this->collSubscriptions = $collSubscriptions;
1960
                $this->collSubscriptionsPartial = false;
1961
            }
1962
        }
1963
1964
        return $this->collSubscriptions;
1965
    }
1966
1967
    /**
1968
     * Sets a collection of ChildSubscription objects related by a one-to-many relationship

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

@@ 1333-1375 (lines=43) @@
1330
     * @return ObjectCollection|ChildConnection[] List of ChildConnection objects
1331
     * @throws PropelException
1332
     */
1333
    public function getConnections(Criteria $criteria = null, ConnectionInterface $con = null)
1334
    {
1335
        $partial = $this->collConnectionsPartial && !$this->isNew();
1336
        if (null === $this->collConnections || null !== $criteria  || $partial) {
1337
            if ($this->isNew() && null === $this->collConnections) {
1338
                // return empty collection
1339
                $this->initConnections();
1340
            } else {
1341
                $collConnections = ChildConnectionQuery::create(null, $criteria)
1342
                    ->filterByUser($this)
1343
                    ->find($con);
1344
1345
                if (null !== $criteria) {
1346
                    if (false !== $this->collConnectionsPartial && count($collConnections)) {
1347
                        $this->initConnections(false);
1348
1349
                        foreach ($collConnections as $obj) {
1350
                            if (false == $this->collConnections->contains($obj)) {
1351
                                $this->collConnections->append($obj);
1352
                            }
1353
                        }
1354
1355
                        $this->collConnectionsPartial = true;
1356
                    }
1357
1358
                    return $collConnections;
1359
                }
1360
1361
                if ($partial && $this->collConnections) {
1362
                    foreach ($this->collConnections as $obj) {
1363
                        if ($obj->isNew()) {
1364
                            $collConnections[] = $obj;
1365
                        }
1366
                    }
1367
                }
1368
1369
                $this->collConnections = $collConnections;
1370
                $this->collConnectionsPartial = false;
1371
            }
1372
        }
1373
1374
        return $this->collConnections;
1375
    }
1376
1377
    /**
1378
     * Sets a collection of ChildConnection objects related by a one-to-many relationship
@@ 1583-1625 (lines=43) @@
1580
     * @return ObjectCollection|ChildSubscription[] List of ChildSubscription objects
1581
     * @throws PropelException
1582
     */
1583
    public function getSubscriptions(Criteria $criteria = null, ConnectionInterface $con = null)
1584
    {
1585
        $partial = $this->collSubscriptionsPartial && !$this->isNew();
1586
        if (null === $this->collSubscriptions || null !== $criteria  || $partial) {
1587
            if ($this->isNew() && null === $this->collSubscriptions) {
1588
                // return empty collection
1589
                $this->initSubscriptions();
1590
            } else {
1591
                $collSubscriptions = ChildSubscriptionQuery::create(null, $criteria)
1592
                    ->filterByUser($this)
1593
                    ->find($con);
1594
1595
                if (null !== $criteria) {
1596
                    if (false !== $this->collSubscriptionsPartial && count($collSubscriptions)) {
1597
                        $this->initSubscriptions(false);
1598
1599
                        foreach ($collSubscriptions as $obj) {
1600
                            if (false == $this->collSubscriptions->contains($obj)) {
1601
                                $this->collSubscriptions->append($obj);
1602
                            }
1603
                        }
1604
1605
                        $this->collSubscriptionsPartial = true;
1606
                    }
1607
1608
                    return $collSubscriptions;
1609
                }
1610
1611
                if ($partial && $this->collSubscriptions) {
1612
                    foreach ($this->collSubscriptions as $obj) {
1613
                        if ($obj->isNew()) {
1614
                            $collSubscriptions[] = $obj;
1615
                        }
1616
                    }
1617
                }
1618
1619
                $this->collSubscriptions = $collSubscriptions;
1620
                $this->collSubscriptionsPartial = false;
1621
            }
1622
        }
1623
1624
        return $this->collSubscriptions;
1625
    }
1626
1627
    /**
1628
     * Sets a collection of ChildSubscription objects related by a one-to-many relationship