Дон Карлос (kastaneda) wrote,

Про дырявые абстракции на примере ORMов

propel:
  products:
    _attributes:  { phpName: Product }
    id:           ~
    name:         { type: VARCHAR, size: '40', required: true }
    stock_count:  { type: INTEGER, required: true }
    price:        { type: INTEGER, required: true }

class Product extends BaseProduct {
  public function getStockValue() {
    return $this->getStockCount() * $this->getPrice();
  }
}
Когда можно будет без лишних заморочек сделать SELECT * FROM products ORDER BY getStockValue() — вот тогда-то и наступит рай земной, коммунизм и вендокапец. А пока, увы, всё с ORMами грустно.
Tags: q-revo, webdev
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded  

  • 5 comments