@@ 1468-1485 (lines=18) @@ | ||
1465 | public function countSCategories(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) |
|
1466 | { |
|
1467 | $partial = $this->collSCategoriesPartial && !$this->isNew(); |
|
1468 | if (null === $this->collSCategories || null !== $criteria || $partial) { |
|
1469 | if ($this->isNew() && null === $this->collSCategories) { |
|
1470 | return 0; |
|
1471 | } |
|
1472 | ||
1473 | if ($partial && !$criteria) { |
|
1474 | return count($this->getSCategories()); |
|
1475 | } |
|
1476 | ||
1477 | $query = SCategoryQuery::create(null, $criteria); |
|
1478 | if ($distinct) { |
|
1479 | $query->distinct(); |
|
1480 | } |
|
1481 | ||
1482 | return $query |
|
1483 | ->filterByRoute($this) |
|
1484 | ->count($con); |
|
1485 | } |
|
1486 | ||
1487 | return count($this->collSCategories); |
|
1488 | } |
|
@@ 1718-1735 (lines=18) @@ | ||
1715 | public function countSProductss(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) |
|
1716 | { |
|
1717 | $partial = $this->collSProductssPartial && !$this->isNew(); |
|
1718 | if (null === $this->collSProductss || null !== $criteria || $partial) { |
|
1719 | if ($this->isNew() && null === $this->collSProductss) { |
|
1720 | return 0; |
|
1721 | } |
|
1722 | ||
1723 | if ($partial && !$criteria) { |
|
1724 | return count($this->getSProductss()); |
|
1725 | } |
|
1726 | ||
1727 | $query = SProductsQuery::create(null, $criteria); |
|
1728 | if ($distinct) { |
|
1729 | $query->distinct(); |
|
1730 | } |
|
1731 | ||
1732 | return $query |
|
1733 | ->filterByRoute($this) |
|
1734 | ->count($con); |
|
1735 | } |
|
1736 | ||
1737 | return count($this->collSProductss); |
|
1738 | } |