Category : fosrestbundle

I’m working with numbers with a lot of decimal places in my symfony application. In my doctrine entity I have for example this property: /** * @ORMColumn(type="float") */ private float $value; In my mysql database I have this value for example: 0.00000000020828579949508 When I dump that in PHP I’m getting this: float(9.3722658865184E-7). I also made ..

Read more

i’m upgrading symfony’s version from 2.8 to 3.0.9, and after fixing the errors with some library’s versions and other problems, i have tried run the command "php bin/console cache:clear" with problems: C:inetpubwwwroot0forfuture>php bin/console cache:clear // Clearing the cache for the dev environment with debug true [SymfonyComponentConfigExceptionFileLoaderLoadException] [Semantical Error] The annotation "@SensioBundleFrameworkExtraBundleConfigurationRoute" in method H360ParkingBundleControllerDisponibilidadController::indexAction() does ..

Read more

In a migration from Symfony 3.4 to Symfony 5.2 I’m facing following issue: FOSRest Symfony 5 Lexik fos_rest.yaml fos_rest: body_listener: enabled: true disable_csrf_role: ROLE_API format_listener: rules: – { path: ‘^/v1’, priorities: [ ‘json’ ], fallback_format: json, prefer_extension: false } zone: – { path: ^/v1/* } security.yaml api_login: pattern: ^/v1/login stateless: true anonymous: true rovider: mg_users ..

Read more

I creating an API with Symfony 4.4 (FOSRestBundle, Postman) and I would like to do a cache system but cache-controle already no-cache, private. I try this cache system https://symfony.com/doc/current/components/cache.html in my controller: public function readAll(CacheInterface $cache, ProductRepository $productRepository, ParamFetcher $paramFetcher, PaginatorInterface $paginator) { $list = $productRepository->findAll(); $list = $cache->get(‘product_’, function (ItemInterface $item) use ($list) { ..

Read more

The error in question: Entity of type AppEntityNutt is missing an assigned ID for field ‘squirrel’. The identifier generation strategy for this entity requires the ID field to be populated before EntityManager#persist() is called. If you want automatically generated identifiers instead you need to adjust the metadata mapping accordingly. I’m perfectly able to call the ..

Read more