daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest May 17th, 2018 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. namespace AppRepository;
  2.  
  3. use AppEntityPageModules;
  4. use DoctrineORMEntityRepository;
  5. use DoctrineBundleDoctrineBundleRepositoryServiceEntityRepository;
  6. use SymfonyBridgeDoctrineRegistryInterface;
  7.  
  8. class PageModulesRepository extends EntityRepository
  9. {
  10.  
  11.     public function __construct()
  12.     {
  13.  
  14.     }
  15. }
  16.    
  17. namespace AppController;
  18. use AppRepositoryPageModulesRepository;
  19. use DoctrineCommonAnnotationsAnnotationReader;
  20. use SymfonyComponentHttpFoundationJsonResponse;
  21. use SymfonyComponentHttpFoundationRequest;
  22. use SymfonyComponentRoutingAnnotationRoute;
  23. use SymfonyBundleFrameworkBundleControllerController;
  24.  
  25. use SymfonyComponentSerializerMappingFactoryClassMetadataFactory;
  26. use SymfonyComponentSerializerMappingLoaderAnnotationLoader;
  27. use SymfonyComponentSerializerNormalizerObjectNormalizer;
  28. use SymfonyComponentSerializerSerializer;
  29. class ApiController extends Controller
  30. {
  31.     /**
  32.      * @Route("/api", name="api")
  33.      */
  34.     public function index()
  35.     {
  36.  
  37.         $do = $this->getDoctrine();
  38.         $treeR = $do->getRepository(PageModulesRepository::class);
  39.  
  40.         return $this->json([
  41.             'message' => 'Welcome to your new controller!',
  42.             'path' => 'src/Controller/ApiController.php',
  43.         ]);
  44.     }
  45. }
  46.    
  47. parameters:
  48.     # Adds a fallback DATABASE_URL if the env var is not set.
  49.     # This allows you to run cache:warmup even if your
  50.     # environment variables are not available yet.
  51.     # You should not need to change this value.
  52.     env(DATABASE_URL): ''
  53.  
  54. doctrine:
  55.     dbal:
  56.         # configure these for your database server
  57.         driver: 'pdo_mysql'
  58.         server_version: '5.7'
  59.         charset: utf8mb4
  60.         default_table_options:
  61.             charset: utf8mb4
  62.             collate: utf8mb4_unicode_ci
  63.  
  64.         url: '%env(resolve:DATABASE_URL)%'
  65.     orm:
  66.         auto_generate_proxy_classes: '%kernel.debug%'
  67.         naming_strategy: doctrine.orm.naming_strategy.underscore
  68.         auto_mapping: true
  69.         mappings:
  70.             App:
  71.                 is_bundle: false
  72.                 type: annotation
  73.                 dir: '%kernel.project_dir%/src/Entity'
  74.                 prefix: 'AppEntity'
  75.                 alias: App
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top