Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 21, 2024 via composer

doctrine/orm 2.16.0

Object-Relational-Mapper for PHP
Package summary
Share
0
issues
1
license
24
MIT
Package created
10 Oct 2011
Version published
1 Aug 2023
Maintainers
2
Total deps
24
Direct deps
15
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
24 Packages, Including:
doctrine/cache@2.2.0
doctrine/collections@2.2.2
doctrine/common@3.4.4
doctrine/dbal@3.8.3
doctrine/deprecations@1.1.3
doctrine/event-manager@2.0.0
doctrine/inflector@2.0.10
doctrine/instantiator@2.0.0
doctrine/lexer@2.1.1
doctrine/orm@2.16.0
doctrine/persistence@3.3.2
psr/cache@3.0.0
psr/container@2.0.2
psr/log@3.0.0
symfony/console@v6.4.6
symfony/deprecation-contracts@v3.4.0
symfony/polyfill-ctype@v1.29.0
symfony/polyfill-intl-grapheme@v1.29.0
symfony/polyfill-intl-normalizer@v1.29.0
symfony/polyfill-mbstring@v1.29.0
symfony/polyfill-php72@v1.29.0
symfony/polyfill-php80@v1.29.0
symfony/service-contracts@v3.4.2
symfony/string@v7.0.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

15
All Dependencies CSV
ⓘ This is a list of doctrine/orm 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
doctrine/cache2.2.015.99 kBMIT
prod
doctrine/collections2.2.2-MIT
prod
doctrine/common3.4.4-MIT
prod dev
doctrine/dbal3.8.3-MIT
prod
doctrine/deprecations1.1.37.42 kBMIT
prod
doctrine/event-manager2.0.05.95 kBMIT
prod
doctrine/inflector2.0.10-MIT
prod
doctrine/instantiator2.0.010.75 kBMIT
prod
doctrine/lexer2.1.1-MIT
prod
doctrine/persistence3.3.2-MIT
prod
psr/cache3.0.06.01 kBMIT
prod dev
psr/log3.0.06.77 kBMIT
prod dev
symfony/consolev6.4.6182.96 kBMIT
prod dev
symfony/polyfill-php72v1.29.0-MIT
prod
symfony/polyfill-php80v1.29.0-MIT
prod

Visualizations

Frequently Asked Questions

What does doctrine/orm do?

The Doctrine ORM (Object-Relational-Mapper) is a highly powerful database abstraction tool for PHP 7.1+ that allows for transparent persistence of PHP objects. It offers a proprietary Object Oriented SQL dialect, known as Doctrine Query Language (DQL), which was inspired by Hibernate’s HQL. This allows developers to write database queries with more flexibility, without creating redundant code.

How do you use doctrine/orm?

Using Doctrine ORM in a PHP application involves a few key steps. First, you need to install it using Composer. This can be achieved by running the following command in your terminal: composer require doctrine/orm.

Once installed, you can setup the EntityManager, which is the primary access point to ORM functionality provided by Doctrine:

<?php
require_once "vendor/autoload.php";

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;

$paths = array("/path/to/entity-files");
$isDevMode = false;

// the connection configuration
$dbParams = array(
    'driver'   => 'pdo_mysql',
    'user'     => 'root',
    'password' => 'password',
    'dbname'   => 'mydb',
);

$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$entityManager = EntityManager::create($dbParams, $config);

And then interact with your database using Doctrine's API:

<?php
// src/Product.php
/** @Entity */
class Product
{
    /**
     * @var int
     * @Id @Column(type="integer") @GeneratedValue
     */
    private $id;

    /**
     * @var string
     * @Column(type="string")
     */
    private $name;
    
    //.. (add getters and setters here)
}

In the above code the notation /** @Entity */ is a Doctrine annotation marking this class as an entity class.

More about associative mappings, fetching objects, querying, and more can be found in the official documentation.

Where are the doctrine/orm docs?

For complete details on how to use the Doctrine ORM, you can refer to the project's extensive documentation. This comprehensive guide provides detailed instructions and examples to help you harness the full power of the Doctrine ORM in your PHP applications.