No video

Intro to Doctrine PHP - DataBase Abstraction Layer - Query Builder - Full PHP 8 Tutorial

  Рет қаралды 25,176

Program With Gio

Program With Gio

Күн бұрын

In this lesson, we learn about Doctrine Database Abstraction Layer library. We learn how to use query builder, how to inspect database schema & so on.
SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: / programwithgio
THANK YOU!
🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b9...
Domains on Namecheap - namecheap.pxf....
Envato Elements - 1.envato.marke...
Adobe Photoshop & Premiere - clk.tradedoubl...
COURSE PLAYLIST
• Learn PHP The Right Wa...
RESOURCES
Source Repo - github.com/gge...
Doctrine DBAL - www.doctrine-p...
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

Пікірлер: 67
@Zubbee
@Zubbee 2 жыл бұрын
Learning new things even more. Thanks Gio. The refactoring is a intriguing. And the videos have become faster which is great cause I'm sure it lets you squeeze in more stuff and then we can slow it down or taking it easy so we can get all the stuff you squeezed in out. I recommended the series directly to someone today and I think he has started from the first video already. Thanks again Gio
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
That's awesome, thank you 💙
@hannanmiah1240
@hannanmiah1240 2 жыл бұрын
Thanks for the most awaited series.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you for your support 💙
@sadhakbj
@sadhakbj 2 жыл бұрын
Can you make some videos on SOLID principles as well? Your content will be the best one in the entire internet.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you. Yes might do that in separate series
@truthteachers
@truthteachers Жыл бұрын
For info: at timestamp 9:50, the type argument "\Doctrine\DBAL\Connection::PARAM_INT_ARRAY" has been deprecated and we need to use "\Doctrine\DBAL\ArrayParameterType::INTEGER".
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Yup, thank you for the note. We use older version in this recording but later videos we have up to date version.
@omaryahia
@omaryahia 7 ай бұрын
I can't be a perfectionist with some topics like doctrine I don't think I need to go into details so I make a trade off I get some value by watching and taking general notes I miss a lot of value by not doing hands-on codes but I accept this risk/loss now, I don't need to slow down I can continue in the playlist as I am the costly decision of getting in-depth + asking questions + hands-on will be saved for topics I feel more relatable to my career in the short term just an approach I am using to manage the gains of my study streak following a curriculum/roadmap I hope I do well
@ProgramWithGio
@ProgramWithGio 7 ай бұрын
Thats fine, you might like the active record pattern ORM like Eloquent from Laravel
@constantinci
@constantinci 2 жыл бұрын
You never fail 😄, thank you.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
😁. Thank you
@memack101
@memack101 2 жыл бұрын
Great video as always.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thanks you
@abdallakaram5376
@abdallakaram5376 2 жыл бұрын
The great Gio thanks alot ❤️
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you 🙌
@hassanasadi3701
@hassanasadi3701 2 жыл бұрын
That's amazing, thank you
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome 👍
@JonasHerbertson
@JonasHerbertson 2 жыл бұрын
Great! Many thanks!
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome 🙌
@user-gv8xg5bh1e
@user-gv8xg5bh1e 7 ай бұрын
Hello, thank you for all these videos. Please tell me how autoload Dotenv\Dotenv. I can do it 'composer require symfony/dotenv' ?
@ProgramWithGio
@ProgramWithGio 6 ай бұрын
We covered that in second section, search the playlist, you will find it
@jackrourke9237
@jackrourke9237 2 жыл бұрын
As always absolutely Love your content and way to teaching ♥ ♥ ♥ ♥ ♥ Can you tell me which package you use to get array key and values on same level to each other like on 3:33? Thank you once again ♥
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you. It's a setting in my IDE under Code Style (PhpStorm).
@jackrourke9237
@jackrourke9237 2 жыл бұрын
@@ProgramWithGio what extra setting parameter you use, can you tell, I also want that one 😊
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Code Style -> PHP -> Wrapping and Braces -> Align consecutive assignments Code Style -> PHP -> Wrapping and Braces -> Align constants Code Style -> PHP -> Wrapping and Braces -> Array Initializer (checked all 4) I think that's all, there might be couple more but it should be all under Wrapping and Braces section so play around with those settings.
@jackrourke9237
@jackrourke9237 2 жыл бұрын
Appreciated! Thank you so much 😊 ♥ ♥ ♥ ♥ ♥
@dileepnadukuru4493
@dileepnadukuru4493 Жыл бұрын
nice tutorial
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thank you
@aruppaul1468
@aruppaul1468 2 жыл бұрын
wow great gio
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Thank you
@GreyDeathVaccine
@GreyDeathVaccine Жыл бұрын
It was good tut... sure enough 😉
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Thanks 😁
@user-gv8xg5bh1e
@user-gv8xg5bh1e 7 ай бұрын
How to create table with doctrine dbal dynamically ?
@ProgramWithGio
@ProgramWithGio 6 ай бұрын
You would typically use migrations, what do you mean by dynamically & what would be the use case?
@pauliusjankauskas8028
@pauliusjankauskas8028 2 жыл бұрын
Thanks for nice tutorial! Just one off topic question: how did you align "connection params"? Is it any default phpstorm shortcut or need to setup phpstorm to do so?
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
ctrl + alt + l if it doesnt work then you can adjust the alignment from the phpstorm settings for PHP
@expresscoding3525
@expresscoding3525 10 ай бұрын
Hello sir, at 9:50, I see [\Doctrine\DBAL\Connection::PARAM_INT_ARRAY] this part is deprecated, what to do?
@ProgramWithGio
@ProgramWithGio 10 ай бұрын
Use \Doctrine\DBAL\ArrayParameterType::INTEGER
@mehdi-vl5nn
@mehdi-vl5nn Жыл бұрын
so an Orm plays as data access and business layer at the same time in a Laravel app for instance?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Yes pretty much
@DigitaSkills101
@DigitaSkills101 2 жыл бұрын
Which exception does the \Doctrine\DBAL\DriverManager::getConnection() throws
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You can inspect th get connection method and see. I don't remember off the top of my head
@po3881
@po3881 11 ай бұрын
In these later videos I find the moving blue background and animations distracting from the content. Just trying to help by mentioning.
@ProgramWithGio
@ProgramWithGio 11 ай бұрын
Thanks for the feedback
@cryptoknight7256
@cryptoknight7256 2 жыл бұрын
Thanks a lot for that video!! .. And so on! lol
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
You're welcome, & so on :D
@mimoh2000
@mimoh2000 Жыл бұрын
Hi Gio, please 2 quick questions. 1. "driver" => 'pdo_mysql' ?? $_ENV['DB_DRIVER']. Without inverting this statement, I get doctrine does not support mysql driver that we had been using despite having pdo_mysql driver installed. Am using Fedora 36. 2. $stmt = $conn->prepare('SELECT * FROM invoices WHERE id = ?'); This line gives the error message below. An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; heck the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1. Still trying to figure out the reason and solution. Any assistance will be highly appreciated.
@mimoh2000
@mimoh2000 Жыл бұрын
Hi, was able to resolve the 2nd part of the question. Binding the position or named parameter and calling the executeQuery() without parameter resolved the issue. Using named parameter: $stmt = $conn->prepare('SELECT * FROM invoices WHERE id = :id'); $stmt->bindValue('id', 100); $result = $stmt->executeQuery(); using position parameter: $stmt = $conn->prepare('SELECT * FROM invoices WHERE id = ?'); $stmt->bindValue(1, 100); $result = $stmt->executeQuery(); The sql error has to dp with mysql keywords or reserved words. But am still unable to figure it out as the id isn't a keyword or reserved word. Will keep digging.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Hey, glad you figured it out. The query looks correct, you do need to bind the values though which you did seems like, if you are still getting an error send me a DM on twitter & send me the screenshot of your actual code and I can help troubleshoot. About your first question, pdo_mysql is the correct driver for pdo mysql. You can also send me screenshot of your code on Twitter & I can take a look.
@themaridv2000
@themaridv2000 10 ай бұрын
​@@ProgramWithGioif I use pdo_mysql, the rest of conections stop working because we have been using just mysql as the DB_DRUVER. I don't know what to do, should i create a new db service and create another db conection that uses pdo_mysql?
@DigitaSkills101
@DigitaSkills101 2 жыл бұрын
Which sql driver is better to use.
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
Whichever you like. I use mysql
@DigitaSkills101
@DigitaSkills101 2 жыл бұрын
@@ProgramWithGio well the doctrine does not support mysql does it have any reason for that
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
It does, we use mysql in this lesson. Check the documentation or the video again (3:21), it uses pdo_mysql. Doctrine supports PDO driver so whatever drivers PDO supports can be used with doctrine.
@truthteachers
@truthteachers Жыл бұрын
Its odd, in the documentation i only get "listTables()" and not "listTableNames()"'. When i look at the definition for ""listTables()"' i able to find "listTableNames". I may be wrong, as I see the documentation is very summary level. Is there anywhere we could get a list of methods for DBAL?
@ProgramWithGio
@ProgramWithGio Жыл бұрын
listTableNames is available on the schema manager, maybe documentation is missing it but you should be able to open up AbstractSchemaManager and see both listTables & listTableNames there
@truthteachers
@truthteachers Жыл бұрын
@@ProgramWithGio Thank you for the reply. Only worrying thing is that we may not know all methods to make best use of the library/extension.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
@@truthteachers you don't need to know. When you have a need for a specific method then you start searching for it. I do agree that Doctrine could use a better documentation. I've had to dig into the source many times
@sefyankehail7801
@sefyankehail7801 Жыл бұрын
Hello Gio, I hope you're having a good day! I have a question right here : 09:26 *executeQuery()* second parameter is an array of arrays right ? because it throws an error when I take off the brackets of $ids ( related to the vendor doctrine DBAL classes )
@ProgramWithGio
@ProgramWithGio Жыл бұрын
Hello. In this case yes because we are using where IN().
@sefyankehail7801
@sefyankehail7801 Жыл бұрын
@@ProgramWithGio Got it, thank you!
@Netz0
@Netz0 Жыл бұрын
Don't use ORM's, just learn SQL, you will thank me later once your application suffers from badly joined queries as it keeps growing.
@ProgramWithGio
@ProgramWithGio Жыл бұрын
I've been using ORMs for a long time along with raw SQL without any problems. I do agree that knowing SQL is essential without it you are just waiting for problems to happen, but if you know SQL and know how ORM works you will be able to build efficient queries
@ollakalla0
@ollakalla0 2 жыл бұрын
Thank you very much for this video, If you can share with us the main class for \App\Enums\InvoiceStatus::tryFrom() that you are calling on kzbin.info/www/bejne/mJe3eomHq7hogKs. I was having something like this before but your functions are very elegant and readable
@ProgramWithGio
@ProgramWithGio 2 жыл бұрын
There is a link to the repo in the description that contains the code. tryFrom is part of the enums feature, you check the lesson about enums where we discuss that.
@ollakalla0
@ollakalla0 2 жыл бұрын
@@ProgramWithGio Thanks a alot
Doctrine ORM - PHP Entities & Data Mapper Pattern - Full PHP 8 Tutorial
26:18
Doctrine ORM Query Builder - Full PHP 8 Tutorial
19:48
Program With Gio
Рет қаралды 16 М.
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 14 МЛН
Little brothers couldn't stay calm when they noticed a bin lorry #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 19 МЛН
Running With Bigger And Bigger Feastables
00:17
MrBeast
Рет қаралды 148 МЛН
PHP Attributes - Simple Router With Attributes - Full PHP 8 Tutorial
22:59
PHP Generators Explained - Full PHP 8 Tutorial
25:47
Program With Gio
Рет қаралды 30 М.
Data Transfer Objects - What Are DTOs - Full PHP 8 Tutorial
13:03
Program With Gio
Рет қаралды 41 М.
Are tests really that bad?
4:32
Program With Gio
Рет қаралды 2,4 М.
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Brawl Stars
Рет қаралды 14 МЛН