Chapters
37 Chapters
|
3:43:31
|
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.2",
"ext-ctype": "*",
"ext-iconv": "*",
"api-platform/core": "^3.0", // v3.1.2
"doctrine/annotations": "^2.0", // 2.0.1
"doctrine/doctrine-bundle": "^2.8", // 2.8.3
"doctrine/doctrine-migrations-bundle": "^3.2", // 3.2.2
"doctrine/orm": "^2.14", // 2.14.1
"nelmio/cors-bundle": "^2.2", // 2.2.0
"nesbot/carbon": "^2.64", // 2.66.0
"phpdocumentor/reflection-docblock": "^5.3", // 5.3.0
"phpstan/phpdoc-parser": "^1.15", // 1.16.1
"symfony/asset": "6.2.*", // v6.2.5
"symfony/console": "6.2.*", // v6.2.5
"symfony/dotenv": "6.2.*", // v6.2.5
"symfony/expression-language": "6.2.*", // v6.2.5
"symfony/flex": "^2", // v2.2.4
"symfony/framework-bundle": "6.2.*", // v6.2.5
"symfony/property-access": "6.2.*", // v6.2.5
"symfony/property-info": "6.2.*", // v6.2.5
"symfony/runtime": "6.2.*", // v6.2.5
"symfony/security-bundle": "6.2.*", // v6.2.6
"symfony/serializer": "6.2.*", // v6.2.5
"symfony/twig-bundle": "6.2.*", // v6.2.5
"symfony/ux-react": "^2.6", // v2.7.1
"symfony/ux-vue": "^2.7", // v2.7.1
"symfony/validator": "6.2.*", // v6.2.5
"symfony/webpack-encore-bundle": "^1.16", // v1.16.1
"symfony/yaml": "6.2.*" // v6.2.5
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4", // 3.4.2
"mtdowling/jmespath.php": "^2.6", // 2.6.1
"phpunit/phpunit": "^9.5", // 9.6.3
"symfony/browser-kit": "6.2.*", // v6.2.5
"symfony/css-selector": "6.2.*", // v6.2.5
"symfony/debug-bundle": "6.2.*", // v6.2.5
"symfony/maker-bundle": "^1.48", // v1.48.0
"symfony/monolog-bundle": "^3.0", // v3.8.0
"symfony/phpunit-bridge": "^6.2", // v6.2.5
"symfony/stopwatch": "6.2.*", // v6.2.5
"symfony/web-profiler-bundle": "6.2.*", // v6.2.5
"zenstruck/browser": "^1.2", // v1.2.0
"zenstruck/foundry": "^1.26" // v1.28.0
}
}
10 Comments
Using
QueryBuilderoutside ofRepositoryis mixing infrastructure and business logic, seems like a bad idea ... What if we move our dragon treasures from SQL to MongoDB?Hey @randomsymbols
yea, usually it is better to keep the database abstracted from your business rules, but in this case, the
QueryBuilderis part of the ApiPlatform interface. I suppose they chose it that way for a good reason. Besides that, if you switch from SQL to MongoDB you'll still have these architecture issues.Cheers!
hi,my entity has endAt field,datetime type, when i getcollection, i want return DATEDIFF(endAt,NOW()) as leftDay and order by leftDay,
so i create custom Extensions
of course i create custom DQL function and work fine
but: return is array [Entity,leftDay] not Entity object, please how fix it.thanks
Hey @Yangzhi!
Sorry for the slow reply - holidays!
Try this:
The
HIDDENshould allow you to select the field so that you can sort by it, but not include it in the results. Let me know if that works!Cheers!
thank you,but in my case,i want use leftDay
Hey @Yangzhi
If the
leftDayfield is not part of your entity data Doctrine will add it to the result along with the entity object. If you want both things in a single object you can create a DTOCheers!
Hello !
I think there is a typo, the correct command seems to be
symfony php bin/phpunit --filter=testGetCollectionOfTreasuresand not
symfony php bin/console phpunit --filter=testGetCollectionOfTreasuresThanks :-)
Hey @Sylvain-B
You're right! Thank you, I'll fix it up
Cheers!
Hello!
This is not a technical inquiry, I just wanted to point out that in some videos, like this one, the subtitles are not well synchronized. As a non-native English speaker, I have to say that this makes it difficult for me to understand because when I don't understand something and go to the subtitles, they are at a different moment than the audio.
If you can review this, I'm sure that future users who need subtitles will appreciate it.
Thank you!
Hey @Oleguer-C!
I appreciate you mentioning this - that's a bug in this video, from a mistake I made in the script. The subtitles should always be perfectly sync'ed, but that mistake definitely caused a bit un-sync starting at 2:42. We'll get that fixed up!
Cheers!
"Houston: no signs of life"
Start the conversation!