Chapters
25 Chapters
|
2:34:05
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"knplabs/knp-time-bundle": "^1.18", // v1.19.0
"symfony/asset": "6.1.*", // v6.1.0-RC1
"symfony/console": "6.1.*", // v6.1.0-RC1
"symfony/dotenv": "6.1.*", // v6.1.0-RC1
"symfony/flex": "^2", // v2.4.5
"symfony/framework-bundle": "6.1.*", // v6.1.0-RC1
"symfony/http-client": "6.1.*", // v6.1.0-RC1
"symfony/monolog-bundle": "^3.0", // v3.8.0
"symfony/runtime": "6.4.3", // v6.4.3
"symfony/twig-bundle": "6.1.*", // v6.1.0-RC1
"symfony/ux-turbo": "^2.0", // v2.1.1
"symfony/webpack-encore-bundle": "^1.13", // v1.14.1
"symfony/yaml": "6.1.*", // v6.1.0-RC1
"twig/extra-bundle": "^2.12|^3.0", // v3.4.0
"twig/twig": "^2.12|^3.0" // v3.4.0
},
"require-dev": {
"symfony/debug-bundle": "6.1.*", // v6.1.0-RC1
"symfony/maker-bundle": "^1.41", // v1.42.0
"symfony/stopwatch": "6.1.*", // v6.1.0-RC1
"symfony/web-profiler-bundle": "6.1.*" // v6.1.0-RC1
}
}
3 Comments
I have a quick Question not sure if you can or want to help :P, because you not discussing updating to the database in this course
I have created a service and trying to update a subscription
But I am using EntityManager beginTransaction *method within a try and catch just in case if fails it will revert/ rollback all changes.
But I am getting an error saying "There is no active transaction". But it still updated the entity, which makes it confusing.
How looking around to fix this issue but couldn't get a clear anwser.
Should I just remove the BeginTransactio Method...and just manually revert back all changes if there is an error?
Awesome courses at Symfony cast keep it up!
Error:
Service
Update:
I have changed:
to :
Now it works fine
Hey @Teddy-B!
Was the exception being caused by the
$this->entityManager->commit();in your catch? If so, that makes sense as you've just rolled back above (closing the transaction).You might also try
$this->entityManager->wrapInTransaction(). I typically prefer using this as it has some extra logic to handle edge cases.Cheers!
No is it still gives the error even if I remove the $this->entityManager->commit()
Thank for your Reply..I will give wrapInTransaction a try
"Houston: no signs of life"
Start the conversation!