src/Controller/MainController.php line 56

Open in your IDE?
  1. <?php
  2. // src/Controller/MainController.php
  3. namespace App\Controller;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  7. use Doctrine\ODM\MongoDB\DocumentManager;
  8. use App\Document\User;
  9. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  10. use App\Controller\NotificationController;
  11. use App\Controller\WalletController;
  12. use App\Controller\CurrenciesController;
  13. use Symfony\Contracts\HttpClient\HttpClientInterface;
  14. use App\Document\Symbol;
  15. class MainController extends AbstractController
  16. {
  17.     
  18.     
  19.     
  20.     
  21.     #[Route('/pub/test' ,  name'home_page_test')]
  22.     public function testest(DocumentManager  $doctrine   ):Response
  23.     {
  24.         
  25.                 $symbols $doctrine->createQueryBuilder(Symbol::class)
  26.     ->field('quoteCurrency')->equals('USDT')
  27.     ->getQuery()
  28.     ->execute();
  29.     
  30.     
  31.     $symbolsCount $doctrine->createQueryBuilder(Symbol::class)
  32.     ->field('quoteCurrency')->equals('USDT')
  33.     ->getQuery()
  34.     ->execute()
  35.     ->count();
  36. echo $symbolsCount ;
  37.         
  38.         
  39.         
  40.            return new Response(
  41.                '<html><body>Lucky number: 77</body></html>'
  42.         );
  43.         
  44.     }
  45.     
  46.     
  47.     #[Route('/' ,  name'home_page')]
  48.     public function number(DocumentManager  $doctrine UserPasswordHasherInterface $passwordHasher HttpClientInterface $client  ):Response
  49.     {
  50.      
  51.    
  52. //     $c = new CurrenciesController($client,$doctrine);
  53. //    $a =  $c->getcurrenciesfromexchange();
  54.         //  $subject = "" ;   $text  = " " ;   $html = "" ;
  55.         //  $email_test = (new NotificationController)->sendemail( $subject ,  $text ,   $html);
  56.         // $tabligh = new User();
  57.         // $test = 113;
  58.         // $tabligh->setUsername($test);
  59.         // $tabligh->setEmail('test');
  60.         // $hashedPassword = $passwordHasher->hashPassword(
  61.         //     $tabligh,
  62.         //     $test
  63.         // );
  64.         // $tabligh->setPassword($hashedPassword);
  65.         // $tabligh->setRoles(["ROLE_ADMIN"]);
  66.  
  67.         // $doctrine->persist($tabligh);
  68.        
  69.         // $doctrine->flush();
  70.      
  71.         return new Response(
  72.                '<html><body>Lucky number: 77</body></html>'
  73.         );
  74.     }
  75. }