Код: Выделить всё
class ActivityReport
{
private $activityService;
public function __construct(Customer $customer, ActivityService $activityService)
{
$this->activityService = $activityService;
}
public function getData()
{
// It will be more code
return $this->activityService->getAll($this->customer->id);
}
}
Код: Выделить всё
class ActivityReportCreator extends ReportCreator
{
private $customer;
function __construct(Customer $customer)
{
$this->customer = $customer;
}
public function generate() {
$activity = new ActivityReport($customer->id);
return $activity->getData();
}
}
Как этого добиться?
Подробнее здесь: https://stackoverflow.com/questions/791 ... ustom-para
Мобильная версия