/** * Return a collection off 1 month ago based on the username supplied * * @param string $username * @return ActivityDayCollection */ private function getCollectionByUsername($username) { $created = new \DateTime("-1 month"); $data = $this->repository->findAfterCreatedByUsername($created, $username); $collection = new ActivityDayCollection(); foreach ($data as $activityUsage) { $collection->add($activityUsage); } return $collection; }