ORMer

From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search

ORMer is a free, open-source (MIT License) object-relational mapping class written in PHP.

Features

The primary goal is to provide ORM functionality while keeping things easy on the developer. It makes no assumptions about table/field naming conventions and requires minimal configuration (no XML config files). For Sqlite2 and MySQL 5.1.x it provides automatic relation discovery through foreign keys.

The most exciting feature is the ability to specify additional stipulations when referencing related data (such as the orders associated with a particular customer). See the second line of code in the example below.

Example

// Pull user objects "where email='me@host.com'"
$users = users::find()->where('email=:email')->parameter('email', 'me@host.com');
 
// Chain through to pull ordered products starting with "a"
// the database contains the following tables: users, orders, order_products, products
// order_products associates products with an order
$products = $users->orders->order_products->products->where('product.name like "a%"');
 
// Loop over them and display their names
foreach($products as $product) {
    echo $product->name;
}

External links

If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...