2710 search results for Doctrine

Search the Request Object OR Query Logic

... totally forgot that we were already filtering WHERE status = approved. But because we put the OR statement inside of the andWhere(), Doctrine surrounded the entire fuzzy search part with parentheses. If we had used orWhere ...

8:05
Publish State Change Validator Logic

... is it changing from false to true? Or true to false? Or maybe it's not changing at all because the PUT request is only updating other fields. And hey! We already know how to get the original data from Doctrine! We did it ...

8:26
Validating Who/When Can Publish

... published, even though the description is short. Next, let's prevent this. How? It's back to our "original data" trick from Doctrine.

8:22
Request Object POST Data

... could do this with an AJAX call instead of a form submit. From a Doctrine and Symfony perspective, it really makes no difference. So I'll keep it simple and leave JavaScript out of this. Let's start by creating that endpoint ...

8:08
Smarter Entity Methods

... new row with null for that column. What we probably want to do is default votes to be zero. How can we set a default value for a column in Doctrine? Actually, that's not really the right question to ask. A better question ...

7:57
ACL Only Owners can PUT a CheeseListing

... Needing the entity manager is so common, let's create another shortcut for it: protected function getEntityManager() that will return EntityManagerInterface. Inside, return self::$container->get('doctrine')->getManager ...

9:23
Passing Entity Ids inside of Messages

... >imagePostRepository->find($imagePostId). That's it! And this fixes our Doctrine problem! Now that we're querying for the entity, when we call flush(), it will correctly save it with an UPDATE. We can remove the persist ...

8:00
Deleting Files

... because of a temporary connection error to the database. If you're worried about this, use a Doctrine transaction to wrap all of this logic. If the file was successfully deleted, commit the transaction. If not, roll it ...

8:58
The POST Create API

... saving. It's just simpler if you can update the state immediately. And that is why UUID's can be awesome. If you configure your Doctrine entities to use UUID's instead of auto-increment ids, you can generate valid UUID's ...

9:04
API Pagination Done Easily

... were doing this in a real project, I'd probably use a library called Pagerfanta. It helps you paginate and has built-in adapters already for Doctrine, and Elastic Search. You can give it things like, we're on page 2 ...

8:48
Finishing with kernel.response and kernel.exception

... Cool. Next, it dispatches kernel.controller, and you can see its listeners. After that, the controller is called and the stuff under that is our work. We can see some Doctrine calls we’re making and the time it takes to ...

5:34
... "solicitud" XML i have defined the relation as you can see below...and the intermediate table got effectively created when i executed the command: vendor\bin\doctrine orm:schema-tool:update --force with two columns and ...
sebastian
sebastian
Read Full Comment
... /silex": "~1.0", "symfony/twig-bridge": "~2.1", "symfony/security": "~2.4", "doctrine/dbal": "^2.5.4", "monolog/monolog": "~1.7.0", "symfony/validator": "~2.4", "symfony ...
叶朱丽
叶朱丽
Read Full Comment
... ): First, `CsvExporter`: ```php namespace App\Service; use Doctrine\ORM\QueryBuilder; use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; use ...
weaverryan
weaverryan
Read Full Comment
... Symfony Forms and use Doctrine and custom html form markup. Will it be more work with validating, etc? Because I have made plenty of forms outside of Symfony and handled the validation etc by myself. But I don't know what the ...
weaverryan
weaverryan
Read Full Comment
... it a temporary user (who has not been registered yet), that user needs a password but when I persisted it in a normal cascade (letting doctrine do its normal work), it did not encrypt the password field so.... I had to ...
weaverryan
weaverryan
Read Full Comment
... ` :/. After chatting internally, I'm going to propose that this is reversed in DoctrineBundle. Then we can ship a recipe with a test Doctrine config to fix this out-of-the-box. > 4. Further to above, how to use a separate ...
weaverryan
weaverryan
Read Full Comment
... " (usually called User, but that doesn't really matter). This class doesn't need to be persisted to Doctrine and can look however you want. Let's take an extreme example: you send a JWT that contains nothing more than a "user id ...
weaverryan
weaverryan
Read Full Comment
... \Entity\UserProfile; use App\Form\Model\DropDownFactory; use Psr\Log\LoggerInterface; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form ...
Oleksandr K.
Oleksandr K.
Read Full Comment
... run php bin/console doctrine:database:create looks like this: [Doctrine\DBAL\Exception\ConnectionException] An exception occured in driver: SQLSTATE[HY000] [2002] Connection refused ...