Resolve "Aggregate Rider Rating" #1689

Open
korina.cordero wants to merge 92 commits from 764-aggregate-rider-rating into 746-resq-2-0-final
Showing only changes of commit 25d7c30f73 - Show all commits

View file

@ -9,7 +9,6 @@ use Symfony\Component\Console\Output\OutputInterface;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use App\Entity\RiderRating;
use App\Entity\AggregatedRiderRating; use App\Entity\AggregatedRiderRating;
use PDO; use PDO;
@ -87,9 +86,21 @@ class LoadAggregateRiderRatingsComand extends Command
{ {
error_log(print_r($agg_rider_ratings, true)); error_log(print_r($agg_rider_ratings, true));
// TODO: create new AggregatedRiderRating object foreach ($agg_rider_ratings as $key => $data)
// set fields {
// save to database // create new AggregatedRiderRating object
$obj = new AggregatedRiderRating();
// set fields
$obj->setRiderId($key)
->setAggregateRating($data['agg_rating'])
->setAggregateCount($data['agg_count']);
// save to database
$this->em->persist($obj);
}
$this->em->flush();
} }
protected function getRiderIds() protected function getRiderIds()