简体   繁体   中英

drupal 7 db_select options

Based on the API of drupal

db_select($table, $alias = NULL, array $options = array())

I would like to ask what is the use of options and how it can be uses. Seems like most sources is ignoring this field. I am hoping to make use of the concept of "Object relational mapping". One object to each database table and add relation to their objects via annotation in PHP.

So I just wanna know if it is possible via drupal 7's API

The $options array seems to go all the way down to DatabaseConnection::$connectionOptions , which is simply:

The connection information for this connection object.

Basically, unless you're scratching your head and thinking "how do I get this option into the database connection string?", you don't need to be using the $options array.

To answer your second question, no, Drupal has no ORM functionality.

There was a module for mapping CCK fields in an ORM fashion for Drupal 6, but it hasn't been touched in a while. There's also no Drupal 7 port, and the DB layer changed so much from D6 - D7 that I doubt any of that will be salvageable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM