Skip to content

ruddhani/Doctrine_Learning

Repository files navigation

Doctrine_Learning

Doctrine is the most effective way of database connection for PHP projects

What's inside?

Doctrine is a Database middleware for PHP, it uses Object Relational Mapper (ORM) and Database Abstraction Layer (DBAL) to securely and effectively interact withDatabase from your Code. This codes, which I have written, will give you the very basics of how to setup and use Doctrine in your simple PHP projects. To learn more you should refer to https://www.doctrine-project.org

  1. To install run composer install

packages/bin/doctrine orm:schema-tool:create

  1. you can add/modify your entities at src/ and can run packages/bin/doctrine orm:schema-tool:update --force

  2. to check what the sql generated packages/bin/doctrine orm:schema-tool:update --force --dump-sql

  3. once database structure created you need to enter some data in your DB: php createUser.php yourname and php createBug.php bugdesc 1

  4. once you populated data you can can now run the doctrine queries/methods

  • _php findUser.php 1 _
  • _php findByUser.php yourname _
  • _php findAllDQL.php _
  • _php findByPagination.php _
  • _php findNativeQuery.php _

Read more @ courtesy : [Doctrine project|https://www.doctrine-project.org]

Releases

No releases published

Packages

 
 
 

Contributors

Languages