propel

How to use MySQL functions in Propel

为君一笑 提交于 2019-12-01 03:07:55
问题 I want to select records that are 1 month old or newer. The query is: SELECT * FROM foobar WHERE created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH) Using Propel in Symfony, I do: $c = new Criteria $c->add(FoobarPeer::CREATED_AT, "DATE_SUB(curdate(), INTERVAL 1 MONTH)", Criteria::GREATER_THAN); What Propel generates is: SELECT * FROM foobar WHERE created_at > 'DATE_SUB(curdate(), INTERVAL 1 MONTH)' - in other words, it puts the MySQL function in single quotes, which makes it a (meaningless)

Propel ORM - Joining unrelated tables

柔情痞子 提交于 2019-11-30 20:22:12
How does this SQL statement translate into Propel (1.6.3)? SELECT * FROM table_a JOIN table_b With tableA and tableB sharing no Foreign Keys and having no relationships defined. TableAQuery::create()->join('tableB') doesn't work since Propel complains with an error: "Fatal error: Uncaught exception 'PropelException' with message 'Unknown relation TableB on the TableA table' Thanks very much in advance for any help and hints! This is my first post here and I hope I haven't done anything wrong yet :-) (I've searched thoroughly before I posted!) You can work around this limitation by using raw

symfony 1.4 propel:build-all not working on Mysql 5.5

大城市里の小女人 提交于 2019-11-30 06:46:18
i am using Symfony 1.4.8 and Mysql 5.5 i got this error when i run symfony propel:build-all You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Type=InnoDB’ at line 1 1 Fixed the issue. It seems that in the DDL, you can’t say “Type=InnoDB|MyISAM|Foo” anymore. You have to say “Engine=InnoDB|MyISAM” so edit one file symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder /sql/mysql/MysqlDDLBuilder.php Line 156, change it as follows:- $script .= “Engine=$mysqlTableType”; A good

phing installed but “not found” and not in pear list

喜你入骨 提交于 2019-11-30 04:48:25
问题 I'm attempting to install the Propel ORM on CentOS which has a dependency for phing. I've run the following which was succesful: pear channel-discover pear.phing.info pear install phing/phing pear install Log However when I run ./propel-gen as is described on the Propel documentation it fails with the error: ./propel-gen: line 69: phing: command not found However if I check to see if phing is installed it doesn't appear in the package list, yet if I try to install it again it fails: $ pear

Propel ORM - Joining unrelated tables

∥☆過路亽.° 提交于 2019-11-30 04:47:47
问题 How does this SQL statement translate into Propel (1.6.3)? SELECT * FROM table_a JOIN table_b With tableA and tableB sharing no Foreign Keys and having no relationships defined. TableAQuery::create()->join('tableB') doesn't work since Propel complains with an error: "Fatal error: Uncaught exception 'PropelException' with message 'Unknown relation TableB on the TableA table' Thanks very much in advance for any help and hints! This is my first post here and I hope I haven't done anything wrong

symfony 1.4 propel:build-all not working on Mysql 5.5

烂漫一生 提交于 2019-11-29 06:54:26
问题 i am using Symfony 1.4.8 and Mysql 5.5 i got this error when i run symfony propel:build-all You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘Type=InnoDB’ at line 1 1 回答1: Fixed the issue. It seems that in the DDL, you can’t say “Type=InnoDB|MyISAM|Foo” anymore. You have to say “Engine=InnoDB|MyISAM” so edit one file symfony/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/builder

Continuous Integration, best practice to input actual test data into database, using Propel ORM

非 Y 不嫁゛ 提交于 2019-11-28 06:48:21
问题 I used Propel ORM to duplicate a table schema, in order to do continuous integration, but Propel only gets me a fully fleshed out schema, it doesn't get me test data (or basic necessary data at all). How do I get the data from a live/test database with a version controlled propel-gen Propel ORM ecosystem? 回答1: They say that "best practice" in anything at all doesn't exist - it's so subjective that one ought to settle for one of several forms of "good practice" instead. I think the below

Propel custom sql for view tables

不打扰是莪最后的温柔 提交于 2019-11-28 01:41:04
For some reason propel is not generating model for view tables, it doesn't even include the structure of the view table if you use the reverse task. So I have no option but to use a custom query. That I know how to do if the model exists: <?php $con = Propel::getConnection(BookPeer::DATABASE_NAME); $sql = "complicated query here..."; $stmt = $con->prepare($sql); $stmt->execute(); but since propel does not generate a model for my view table, i don't know how to do that. I've tried this but it doesn't work <?php $con = Propel::getConnection(MyViewTable::DATABASE_NAME); $sql = "SELECT * FROM

RedBean ORM performance [closed]

扶醉桌前 提交于 2019-11-27 18:11:34
I would like to know, can Redbean ORM be used for performance oriented scenarios like social networking web apps, and is it stable even if thousands of data is pulled by multiple users at same time? Also I'd like to know whether Redbean consumes more memory space? Can anyone offer a comparison study of Doctrine-Propel-Redbean? tereško @tereško if tis possible, can you give the pros and cons of orm with respect to pure sql according to your experience and also i will google the topic at same time. – Jaison Justus Well .. explaining this in 600 characters would be hard. One thing I must clarify:

PHP ORMs: Doctrine vs. Propel

给你一囗甜甜゛ 提交于 2019-11-27 10:21:47
I'm starting a new project with symfony which is readily integrated with Doctrine and Propel , but I of course need to make a choice.... I was wondering if more experienced people out there have general pros and/or cons for going with either of these two? Thanks a lot. EDIT: Thanks for the all the responses, useful stuff. There's no truly correct answer to this question so I'll just mark as approved the one that got the most popular up-votes. I'd go with Doctrine. It seems to me that it is a much more active project and being the default ORM for symfony it is better supported (even though