for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sylius\Component\Core\Dashboard;
use Sylius\Component\Order\Repository\OrderRepositoryInterface;
use Sylius\Component\User\Repository\CustomerRepositoryInterface;
/**
* @author Paweł Jędrzejewski <[email protected]>
class DashboardStatisticsProvider implements DashboardStatisticsProviderInterface
{
* @var OrderRepositoryInterface
private $orderRepository;
* @var CustomerRepositoryInterface
private $customerRepository;
* @param OrderRepositoryInterface $orderRepository
* @param CustomerRepositoryInterface $customerRepository
public function __construct(OrderRepositoryInterface $orderRepository, CustomerRepositoryInterface $customerRepository)
$this->orderRepository = $orderRepository;
$this->customerRepository = $customerRepository;
}
* {@inheritdoc}
public function getStatistics()
return new DashboardStatistics(
$this->orderRepository->getTotalSales(),
$this->orderRepository->count(),
$this->customerRepository->count()
);