2706 search results for Doctrine

Exceptions Part 2 Adding Fence Security

... .. unless there's some security to keep it inside. We've reached the third step of TDD once again: refactor. Actually, I don't need to refactor, but now is a great time to add the missing Doctrine annotations. Above the ...

7:11
Tests Assertions Coding

... property. It does have Doctrine annotations, but that's not important! Sure, we will eventually be able to save dinosaurs to the database, but our test doesn't care about that: it just checks to make sure setting and ...

6:40
Priming cache.app

... automatically makes available. You can also use cache.adapter.filesystem - which is the default - doctrine, apcu, memcached or create your own service. If you need to configure Redis, use the default_redis_provider key under app ...

7:00
Safe Migrations

... ./bin/console doctrine:migrations:diff Go check it out in app/DoctrineMigrations. Wow... it's actually perfect: ALTER TABLE video CHANGE image (to) poster... Doctrine is smart ...

7:10
Void Types Refactoring an Entire Class

... flexible interface. But actually, for Doctrine collections, you must use Collection. Depending on the situation, this property might be an ArrayCollection or a PersistentCollection... both of which implement the Collection ...

7:06
Using a Test Database

... do that, we can setup the test environment to use a different database name. Open config.yml and copy the doctrine configuration. Paste it into config_test.yml to override the original. All we really want to change is ...

6:52
Weird Endpoint The tagline as a Resource

... should be /api/programmers/{nickname}/tagline. To be super hip, add an @Method annotation: we know this should only match PUT requests: Like before, type-hint the Programmer argument so that Doctrine will query for it for ...

5:47
Pagerfanta Pagination

... () - since we're using Doctrine - and pass it the query builder. Next, create a $pagerfanta variable set to new Pagerfanta() and pass it the adapter. On the Pagerfanta object, call setMaxPerPage() and pass it 10. And then ...

6:29
Adding to a Collection Cascade Persist

... Genus.genusScientists that was not configured to cascade persist operations for GenusScientist. Umm, what? Here's what's going on: when we persist the Genus, Doctrine sees the new GenusScientist on the genusScientists array... and ...

6:04
Tracking Cancelations in our Database

... () and then saving it to the database with the standard persist() and flush() Doctrine code: And that should do it! Let's give this guy a try. Go to the account page, then press the new "Cancel Subscription" button. Ok ...

7:57
Give the User a Subscription in our Database

... $stripeSubscription->id: Booya! And, time to save this to the database! Since we're using Doctrine in Symfony, we need the EntityManager object to do this. I'll use dependency injection: add an EntityManager argument to the ...

8:41
After-dinner Mint

... it and set a nullable=true option in the Doctrine metadata. Don’t worry about updating your schema - this change is just temporary: // src/Yoda/UserBundle/Entity/User.php // ... /** @ORM\Column(type="string", length ...

3:35
Server-Side Validation

... \Doctrine\Validator\Constraints\UniqueEntity; /** @ORM\Table(name="yoda_user") @ORM\Entity(repositoryClass="Yoda\UserBundle\Entity\UserRepository") @UniqueEntity(fields="username", message="That username is taken ...

4:18
Code Generation FTW

... need a CRUD for the Event entity. Want to use Doctrine to generate a CRUD? Yea, there's a console command for that doctrine:generate:crud: php app/console doctrine:generate:crud This ...

5:25
Making an Argument Available to All Controllers

... object via Doctrine with that id, and then adds a new request attribute called post that’s set to that object: // Summarized version of ParamConverterListener public function onKernelController(FilterControllerEvent $event ...

3:57
Deployment

... There’s a library called Doctrine Migrations that helps do this safely. Clear your production cache: php app/console cache:clear --env=prod Dump your Assetic assets: php app/console assetic:dump --env=prod That’s it ...

6:51
Twig Extensions and Dependency Injection Tags

... them too often, but they’re key to unlocking really powerful features. A very important tag is kernel.event_listener, which allows you to register “hooks” inside Symfony at various stages of the request lifecycle. That topic is for another screencast, but we’ll cover a very similar subject next: Doctrine events.

4:33
... /php-code-coverage (5.3.2): Downloading (100%) - Installing sebastian/exporter (3.1.0): Downloading (100%) - Installing doctrine/instantiator (1.0.5): Downloading (100%) - Installing phpunit/phpunit-mock-objects ...
toporovvv
toporovvv
Read Full Comment
Hi Two questions regarding doctrine: 1) when I want to save to the db the images from a multi-select form field, I can't save them using doctrine's way. Example: ``` /** * Creates a new product entity. * * @Route ...
Dan Costinel
Dan Costinel
Read Full Comment
... translations for the same language, but for different countries (e.g. British vs UK English). B) Translating your data inside Doctrine is an entirely different task (and you should make sure you need this - it's a lot of extra ...
weaverryan
weaverryan
Read Full Comment