1000 search results

…use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! # - ./docker/db/data:/var/lib/postgresql/data:rw ###< doctrine/doctrine-bundle ### volumes: ###> doctrine/doctrine-bundle ### db-data: ###< doctrine/doctrine-bundle ### ```
22 lines | config/packages/netgen_layouts.yaml
netgen_layouts:
// ... lines 2 - 3
value_types:
doctrine_recipe:
// ... lines 6 - 22
See Code Block in Script
With `symfony console doctrine:fixtures:load --append` it will append data.
57 lines | src/Controller/VinylController.php
// ... lines 1 - 5
use Pagerfanta\Doctrine\ORM\QueryAdapter;
use Pagerfanta\Pagerfanta;
// ... lines 8 - 12
class VinylController extends AbstractController
{
// ... lines 15 - 38
public function browse(VinylMixRepository $mixRepository, string $slug = null): Response
{
// ... lines 41 - 43
$adapter = new QueryAdapter($queryBuilder);
$pagerfanta = Pagerfanta::createForCurrentPageWithMaxPerPage(
$adapter,
1,
9
);
// ... lines 50 - 54
}
}
See Code Block in Script
22 lines | docker-compose.yml
version: '3'
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-13}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}
POSTGRES_USER: ${POSTGRES_USER:-symfony}
volumes:
- db-data:/var/lib/postgresql/data:rw
// ... lines 14 - 22
See Code Block in Script
9 lines | docker-compose.override.yml
version: '3'
services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "5432"
// ... lines 8 - 9
See Code Block in Script
Hey davidmintz The `doctrine/cache` library was deprecated some time ago. I'm not sure how you ran into this problem but I'm guessing you upgraded the DoctrineBundle library. Try upgrading all doctrine libraries by running ``` composer upgrade "doctrine/*" ``` and clear the cache manually…
MolloKhan
MolloKhan
Read Full Comment
Hello Vladimir, installing latest doctrine-migrations-bundle (3.2.2) solved the issue (see also GitHub). But strange that only the messenger consumption per CLI caused an issue. The rest of the website worked perfect with the previous version. Anyway ... many thanks for supporting me…
Hey Mepcuk Doctrine does not impose you any style. If you want your entities to behave as anemic or rich domain model it's up to you and the needs of your application. Cheers!
MolloKhan
MolloKhan
Read Full Comment
87 lines | src/Controller/QuestionController.php
// ... lines 1 - 9
use Pagerfanta\Doctrine\ORM\QueryAdapter;
use Pagerfanta\Pagerfanta;
// ... lines 12 - 17
class QuestionController extends AbstractController
{
// ... lines 20 - 32
public function homepage(QuestionRepository $repository)
{
$queryBuilder = $repository->createAskedOrderedByNewestQueryBuilder();
$pagerfanta = new Pagerfanta(new QueryAdapter($queryBuilder));
$pagerfanta->setMaxPerPage(5);
// ... lines 39 - 42
}
// ... lines 44 - 85
}
See Code Block in Script
…so apparently doctrine cache has been deprecated. https://github.com/doctrine/cache/issues/354, So tried installing an older cache library to make it work. You will need to install this version of Doctrine cache using this in your terminal. ` composer require doctrine/cache:1…
shirleenkneppers
shirleenkneppers
Read Full Comment
I solved everything with doctrine extensions now. Don't know the best practise? Provider or extension? But for me it works great now.
Hey @Antsen There are Doctrine extensions that allows you to create translatable entities also some bundles which helps organising it. Unfortunately can't advice any guidance or best practice yet. Cheers
…stof/doctrine-extensions-bundle --with-all-dependencies Loading composer repositories with package information Restricting packages listed in "symfony/symfony" to "5.1.*" Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires stof/doctrine-extensions…
Jörg daniel F.
Jörg daniel F.
Read Full Comment
If you get "[Doctrine\DBAL\Exception\DriverException] An exception occurred in driver: could not find driver", simply uncomment extension=pdo_sqlite in php.ini in your php installation folder (by deleting ";").
Angelika R.
Angelika R.
Read Full Comment
PhpStrom doesn't generating doctrine repository. How to fix this?
Too many arguments to "doctrine:query:sql" command, expected arguments "sql".
Hey Stileex, Doctrine bundle does not do any rollbacks manually. If you have an automated deploy script - you should care about doing those rollbacks on failed migration execution, i.e. literally execute another Symfony command, but usually it's difficult to achieve on practice because…
38 lines | src/ApiPlatform/CheeseSearchFilter.php
// ... lines 1 - 4
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractFilter;
// ... lines 6 - 8
class CheeseSearchFilter extends AbstractFilter
{
// ... lines 11 - 36
}
See Code Block in Script
Hey there , Doctrine encourage to take over and control transaction demarcation ourself! So how to deal with it? Can you tell me a "good" use-case when to you use it? Big thanks!