Definition of ORM in PHP

Source: Internet
Author: User
ORM (Object relationship ing) is a ing between objects in the memory and relational data. In JAVA hibernate, it can be understood that object operations are performed, however, most php orm uses chained operations (in fact, splicing strings). The last operation will execute the statement, which is equivalent to spelling in the code... ORM (Object relationship ing) is a ing between objects in the memory and relational data. In JAVA hibernate, it can be understood that object operations are performed, however, most php orm uses chained operations (in fact, splicing strings). The last operation will execute the statement, which is equivalent to splicing an SQL statement in the code, so why is it also called An ORM Object Relational ing object?

Reply content:

ORM (Object relationship ing) is a ing between objects in the memory and relational data. In JAVA hibernate, it can be understood that object operations are performed, however, most php orm uses chained operations (in fact, splicing strings). The last operation will execute the statement, which is equivalent to splicing an SQL statement in the code, so why is it also called An ORM Object Relational ing object?

Your question is a bit vague. You mentioned Hibernate in Java, but the question is PHP. First, it is a Java framework and a language.

Question:

The chained operation you mentioned is just to facilitate the final construction of SQL,

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

In this case, query () will return the object itself, which can implement chained operations, but is there a gross relationship With ORM? The object foobar corresponds to the table foobar. Isn't it an ORM? What is the relationship between implementation in the middle?

The materials read by the subject or subject confuse DBAL/DAO and ORM.

Roughly speaking, "join query" is DBAL, and the data record mapped to the object is 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.