F
F
fenric2016-03-28 06:26:54
PHP
fenric, 2016-03-28 06:26:54

PHP ORM, Propel2 or Doctrine2?

Actually the question is in the title, what do you recommend, what did you work with?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2016-03-28
@27cm

Is it really:

$this->select('a.field1')->alias('alias1')->from('table1')->alias('a')
     ->left->join('table2')->alias('b')->on('a.id', '=', 'b.refid')->inner->join('table3')->alias('c')
     ->where('a.price', '='. new Expression('not quotting'))->order('c.ssa')->asc->group('a.saa')
     ->limit(1)->offset(0);

something better and easier to read than:
$query = 'SELECT `a`.`field1` AS `alias1` FROM `table1` `a` '
       . 'LEFT JOIN `table2` `b` ON `a`.`id` = `b`.`refid` INNER JOIN  `table3` `c` '
       . 'WHERE `a`.`price` = ? ORDER BY `c`.`ssa` ASC GROUP BY `a`.`saa` LIMIT 0, 1';
$db->prepare($query); // ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question