The definition of ORM in PHP

Source: Internet
Author: User
ORM (Object-relational mapping) is a mapping of objects in memory and relational data, and in Java, Hibernate can be understood to be an object operation, but most of the PHP ORM is chained (in fact, the string is spliced), the last operation will execute the statement, It's equivalent to splicing a SQL in the code, so why is it called an ORM object-relational mapping object, and where does it behave?

Reply content:

ORM (Object-relational mapping) is a mapping of objects in memory and relational data, and in Java, Hibernate can be understood to be an object operation, but most of the PHP ORM is chained (in fact, the string is spliced), the last operation will execute the statement, It's equivalent to splicing a SQL in the code, so why is it called an ORM object-relational mapping object, and where does it behave?

Your question is a little too vague, Java you point out Hibernate, but the problem is that PHP, first of all, a Java framework, one is a language.

Business:

What you call a chained operation is just to make it easier to finally build SQL,

class Foobar {  public function query() {    return $this  }}

In this, query () returns to the object itself, which allows for chained operations, but does this have a hair-to-orm relationship? Object foobar, corresponding data table Foobar, isn't that an ORM? What does it matter how the middle is achieved?

The main or the main view of the data mixed with Dbal/dao and ORM

Roughly speaking, the "stitching query" is dbal, which maps data records to objects that are ORM

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.