propel

In Symfony 1.2 how can I get the current database name from the database.yml file in Propel?

I have a raw sql query I need to run, but the database name changes in each environment (live: db, dev db_test) I need to get the current database name from the databases.yml file. How can I get just the current database name? I am using the Propel ORM ...

Propel automatic form

Hi, I'm just starting with Propel and for more rapid development I'm curious if there is anything like automatic forms. Something like default administration in Django. I want to be able to output a form or to get all information I'll need. Even in the objects I didn't find all information which should be necessary to have everything for...

Reference another route in your routing.yml in Symfony ?

Developping a plugin, I have a routing.yml in my plugin dir, specifying a route with sfPropelRoute. in my plugins/myPlugin/config/routing.yml : myplugin_test: url: /myurl/:id class: sfPropelRoute options: { model: myClass, type: object, method_for_criteria: selectAvailableObj } params: { module: mymodule, action: show } r...

Accessing the database and sending an email in a symfony batch script

I am running Symfony 1.3.2 on Ubuntu. I need to write a batch script that can: Access the database using the ORM Send email(s) IIRC, this was in a previous cookback, but I thing that was for an earlier version of Symfony (the API may have changed since). Does anyone know how I may access the database via the ORM layer in a batch scr...

Should I use concrete Inheritance or not?

I have a project using Propel where I have three objects (potentially more in the future) Occasion Event extends Occasion Gig extends Occasion Occasion is an item that has the shared things, that will always be needed (Venue, start, end etc) With this - I want to be able to add in extra functionality, say for example, adding "Band" ...

Symfony fk issue on insertion

Hi, I posted a similar problem but it could not be resolved. I create a relational database of users and groups but for some reason I cannot insert test data with fixtures properly. Here is a sample of the schema: User: actAs: { Timestampable: ~ } columns: name: { type: string(255), notnull: true } email: { type: string(255...

How to do a "Select count..." with symfony and propel ??

Hi, I'm trying to do a very simple sql query like this, to a propel Criteria : SELECT count(id_user) FROM myTable WHERE id_page = 5 I did'nt found informations on the documentation. Have you an idea ?? ...

Symfony models with foreign keys

So I have 2 models. Users and Groups. Each group has a user as the creator and a group has many users. The FK of these tables are set up correctly, but I was wondering if there was an easier way to get all related FK objects from other objects. For example, with a group object, is there a built in method to get the user object of the cre...

Form submission with errors don't display the errors...

Hi, I have a problem with my form and ajax. Indeed, when the form is correctly fillin, datas are send into the database, but when the form is not correctly fillin, the errors "this input is required..." are never displayed (in spite of I have a validator for this). This is my code of my action.class : public function executeDetails()...

How to do a join with ttwo tables ??

HI, I try to translate this query : SELECT * FROM `reunion` , lieu WHERE reunion.lieu_reunion = lieu.id_lieu to propel query : $c=new Criteria(); $c->addJoin(ReunionPeer::LIEU_REUNION,LieuPeer::ID_LIEU, Criteria::LEFT_JOIN); $this->reunions = ReunionPeer::doSelect($c); But in my template, when I made a print_r($reunions), the fie...

Install propel_generator 1.2?

I'm trying to install propel_generator version 1.2 (later versions are incompatible with the project I'm working on). I've tried pear install propel/propel_generator-1.2 But I get the following error: Failed to download propel/propel_generator, version "1.2", latest release is version 1.5.2, stability "stable", use "channel://pear....

How to store Propel objects into file?

I need to have option for Propel to store the data into database and file as well. Is there any way how to do that? I'll create the objects, fill the data and then need to store them into file (session) and be able to recreate the objects later. In some time it will go to database as well. Any idea? ...

inheritance issues with propel 1.5.2

In propel 1.3 and 1.4 the following inheritance structure worked fine. table name="payment_method" baseClass="rwf.lib.SymmetricEncryptedObject"> column name="id" type="INTEGER" required="true" autoIncrement="true" primaryKey="true"/> column name="discriminator" type="INTEGER" inheritance="single" required="true"> in...

How to translate this SQL query with propel ??

Hi, i don't know how to translate this query : SELECT distinct(id_ville) FROM `point_location` I try to do it, but it doesn't work : $c = new Criteria(); $c->add(PointLocationPeer::ID_VILLE, Criteria::DISTINCT); $c->setDistinct(); $this->villes = PointLocationPeer::doSelect($c); ...

Symfony propel:insert-sql with specified user?

I am running Symfony 1.3.6 on Ubuntu Lucid. My db connections for Symfony are made with a user with reduced priveleges (no need for CREATE or DROP for example) - for security reasons. I want to be able to run the propel task propel:sql-insert as root, so that I can create/drop tables at will. The brain dead way to do this would be to m...

The WHERE IN clause using propel in symfony

Hi, I am new to symfony and propel . How can I create the following query using propel ? "UPDATE tablename SET status = 1 WHERE id IN (1,2,3,4)"; Thanks. ...

Doctrine schema - avoid sql generation for specific table

Hello everyone, i'm kinda new to Doctrine, been using Porpel before.. I'd like to generate model classes from my schema, but the objects will be stored in a mongoDB - thus i don't need/want Doctrine to generate and insert the SQL for those tables. In Propel there was a handy attribute (skipSql: true) which worked like a charm for ...

Symfony 1.4 - Updating hidden value when form is updated

Hey I am trying to modify the default value of a form field every time the form is updated. I have tried to edit the $form->bind in my processForm (..) but I am unsure how to do so. Is it possible to get some example code or any approaches to do? The field name is 'processed' and I am trying to set the value to 'false' - Using Symfony...

PHP: Choosing ORM for future expansion and changes?

Hi everybody, I come from a Codeigniter MVC background that we've been working with for some time now. It's time to roll our own framework for a big project, but we have come now to the Database part and got a bit confused immediately. In Codeigniter, we've used the ActiveRecord for all SQL database connections, which has worked well, b...

Propel: negate multiple conditions

I need to negate multiple conditions at once using Propel. E. g. a corresponding sql condition is: WHERE !(something = 'a' and someOtherThing = 'b') I couldn't find a way to solve this using Propel ORM. Is there a way to build this query with the Criteria-API that Propel 1.3 provides? ...