propel

How do I enable LOAD DATA LOCAL INFILE in Propel?

…衆ロ難τιáo~ 提交于 2019-12-11 13:11:05
问题 I've tried the solutions from other answers, but so far none have resolved: PDOException 42000 SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version I'm preparing a query using PropelPDO. I've tried: $cnct = \Propel::getConnection(); $cnct->setAttribute(\PDO::MYSQL_ATTR_LOCAL_INFILE, true); But this did not prevent the error, so I also tried: $prepare = $cnct->prepare($sql, array( \PDO::MYSQL_ATTR_LOCAL_INFILE => true, )); $prepare-

Can someone tell me how to obtain indirectly related classes using Propel ModelCriteria?

左心房为你撑大大i 提交于 2019-12-11 07:16:53
问题 I'd like some help from the community, if possible. We have a project at work, and time has come for refactoring. We are using PHP 5 and Propel 1.6 as ORM layer. The idea, actually, is pretty simple: we are trying to obtain all relevant information at the same time. However, this information is not always directly related to the main class (or, in other words, to the main table). For example: return ( $this->leftJoin( "IES.Pessoa mant" ) ->leftJoin( "mant.Papel subpapel" ) ->where( "subpapel

Propel ORM Behavior for defining Parent Child relationships?

馋奶兔 提交于 2019-12-11 05:58:20
问题 I'm using Symfony2 with PropelBundle, and lets say I have the following schema: <table name="person"> <column name="id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="name" type="VARCHAR" size="100" required="true"/> </table> <table name="person_parent"> <column name="person_id" type="INTEGER" primaryKey="true" required="true"/> <column name="parent_id" type="INTEGER" primaryKey="true" required="true"/> </table> Consider that a person can have many

Recursively hydrate all related objects in Propel

拥有回忆 提交于 2019-12-11 05:29:07
问题 Is there a simple way to recursively hydrate all related objects when performing a query? Let's say I have the following tables: Song Composer Century When I do a SongPeer::doSelectJoinAll() only the related composers are hydrated, so if I then do something like $song->getComposer()->getCentury() , a new query will be performed. I want to perform only one query to the DB so when I call $song->getComposer()->getCentury() within a loop on all my songs objects, it doesn't end up in n additional

Symfony2: How to make a pgsql database reverse enginering process with PropelBundle?

瘦欲@ 提交于 2019-12-11 05:09:44
问题 I've successfully integrated Symfony2 with PropelBundle but I'm having troubles to realize a reverse engineering process with a pgsql driver over a database deployed in a posgresql-8.4 server. In order to do that I ran a php app/console propel:reverse command to generate the XML schema and I obtained the following error: [propel-schema-reverse] There was an error building XML from metadata: SQLSTATE[42704]: Undefined object: 7 ERROR: unrecognized configuration parameter "tables" Any ideas? My

Naming Generated Functions in Propel

╄→гoц情女王★ 提交于 2019-12-11 03:52:56
问题 The ideo of cross-reference tables is introduced in Propel 1.5. This means that an entity can get a list of related items as if it were a one-to-many relation. So in a person-to-groups relationship, a person can call getGroups() , and a group can call getPersons() . This makes things much easier to handle. However, if an entity has a many-to-many relationship to itself, the names of the function calls become more complex. As an example, the following permits groups to contain groups within

Struggling with one-to-many relation in an admin form

元气小坏坏 提交于 2019-12-11 02:06:52
问题 I do apologize if the answer to my question would be very obvious. I am new to Symfony and I wasn't able to find another question with exactly the same issue as mine at SO, thus I am posting a question. (And Google didn't help much either, but then again I am not very familiar with Symfony's terminology, so I might have worded my queries badly.) So, straight to the point. The schema.yml : user: id: email: { type: varchar, size: 255, required: true } ... # etc. partner: user_id: { type:

symfony2 propel crud generator

核能气质少年 提交于 2019-12-11 01:57:49
问题 Hi not sure why I cannot find an answer for this already im sure im not the first person that wants to do this. Ive just started using symfony again after 4 years and Im trying to use symfony2 with propel. I have used propel for many yours and get on well with it so would like to continue using it. In symfony 1.x there used to be crud generators I see there still is in symfony2 but only for doctrine. Is there any support and/or plugin available for easy crud generation for propel in symfony2

Primary key + Composite primary key causing issue in propel database schema

与世无争的帅哥 提交于 2019-12-10 22:07:50
问题 I have a table that uses an auto-incremented primary key and it has several fields. <column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" /> <column name="field1" type="INTEGER" required="true" /> <column name="field2" type="INTEGER" required="true" /> <column name="field3" type="INTEGER" /> <column name="field4" type="INTEGER" /> <column name="field5" type="INTEGER" /> I want to make sure that a field1 + field2 combo isn't used more than once, so I added

How to order by multiple columns with propel

大城市里の小女人 提交于 2019-12-10 20:32:43
问题 I need to sort a query by 2 columns. Is this possible using propel? i tried: $c->addAscendingOrderByColumn(self::COL1); $c->addAscendingOrderByColumn(self::COL2); but the second call to addAscendingOrderByColumn overrides the first one. Regards, Radu. 回答1: Unfortunately, if you are using Propel 1.4 (Symfony 1.4), it seems that you will have to switch to raw SQL there... No answer in the (old) Symfony forum : http://oldforum.symfony-project.org/index.php/m/90447/ However, since Propel 1.5 it