protected function import(InputInterface $input, OutputInterface $output)
 {
     // Getting php array of data from CSV
     $data = $this->get($input, $output);
     // Getting doctrine manager
     $em = $this->getContainer()->get('doctrine')->getManager();
     // Turning off doctrine default logs queries for saving memory
     $em->getConnection()->getConfiguration()->setSQLLogger(null);
     // Define the size of record, the frequency for persisting the data and the current index of records
     $size = count($data);
     $batchSize = 10;
     $i = 1;
     // Starting progress
     $progress = new ProgressBar($output, $size);
     $progress->start();
     // Processing on each row of data
     foreach ($data as $row) {
         //Create new collaborator, find his agency
         $collaborator = new Collaborator();
         $agency = $em->getRepository('CharlestownAgencyBundle:Agency')->find($row['code_agence']);
         //Update is infos
         $collaborator->setUsername($row['id']);
         $collaborator->setPlainPassword($row['password']);
         $collaborator->setAgency($agency);
         $collaborator->setEmail($row['mail']);
         $collaborator->setLastName($row['nom']);
         $collaborator->setFirstName($row['prenom']);
         $collaborator->setPortPhoneNumber($row['portable']);
         $collaborator->setPhoneNumber($row['fixe']);
         $collaborator->addRole('ROLE_USER');
         $collaborator->addRole('ROLE_ADMIN');
         $collaborator->addRole('ROLE_AE');
         $collaborator->addRole('ROLE_EVENT');
         $collaborator->setEnabled(true);
         // Persisting the current user
         $em->persist($collaborator);
         // Each 20 users persisted we flush everything
         if ($i % $batchSize === 0) {
             $em->flush();
             // Detaches all objects from Doctrine for memory save
             $em->clear();
             // Advancing for progress display on console
             $progress->advance($batchSize);
             $now = new \DateTime();
             $output->writeln(' of admins imported ... | ' . $now->format('d-m-Y G:i:s'));
         }
         $i++;
     }
     // Flushing and clear data on queue
     $em->flush();
     $em->clear();
     // Ending the progress bar process
     $progress->finish();
 }