CustomerManagement.php 876 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Customer\Model;
  7. use Magento\Customer\Api\CustomerManagementInterface;
  8. use Magento\Customer\Model\ResourceModel\Customer\CollectionFactory;
  9. class CustomerManagement implements CustomerManagementInterface
  10. {
  11. /**
  12. * @var CollectionFactory
  13. */
  14. protected $customersFactory;
  15. /**
  16. * @param CollectionFactory $customersFactory
  17. */
  18. public function __construct(CollectionFactory $customersFactory)
  19. {
  20. $this->customersFactory = $customersFactory;
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function getCount()
  26. {
  27. $customers = $this->customersFactory->create();
  28. /** @var \Magento\Customer\Model\ResourceModel\Customer\Collection $customers */
  29. return $customers->getSize();
  30. }
  31. }