doctrine

Translation Table Delete Issue

Hello Friends, I'm using Symfony 1.4. My project is multi langual. So i'm using translation table. So from database i'm creating schema, them model , then form. Each time i have Delete Translation class from model doctrine. I don't want to do that each time. Can anybody have solution for this ? ...

I need help with complex join

There is one-2-many relation between Property and Reservation. Property has column called 'nr_of_bookings'. I need DQL that will retrieve only the properties that has COUNT(Reservation) less than Property.nr_of_bookins. An example: Some Property has nr_of_bookings = 3 . If it has 5 Reservations related, it will not be retrieved. But if ...

How to figure out the Foreign Key Constraints of a MySQL table using Doctrine 1.1?

When two models are related to each other, Doctrine automatically generates foreign key constraints in the MySQL database beautifully. The default behaviour for onDelete and onUpdate RESTRICT, but can also be set to SET NULL or CASCADE. Now, I want to create a migration diff from an existing database compared to a YAML file. To do this,...

error using doctrine:build --all symfony 1.4.4 apostrophe trunk

Hi, I'm stumped on why when I do doctrine:build -all it throws 2 warnings. I've tried commenting out all the schema.yml files and it still throws it. Anyone better informed help me understand where it is coming from, is there some caching I am unaware of? I've deleted the cache (./symfony cc). Manually deleted all the lib/ models, forms...

Symfony Widget: sfWidgetFormDoctrineChoice vs. i18n - Undefined column

Hi. For a form I want to retrieve all entries of a table. Therefore I use the getChoices method of the sfWidgetFormDoctrineChoice class. protected function getPaymentTypes(){ $typesWidget = new sfWidgetFormDoctrineChoice( array( 'model'=>'PaymentType', 'method'=>'getName', 'order_by'=...

Symfony CSRF attack detected everytime I submit a form

The login form works fine, but any other form I submit (things like editing or creating data) I get a CSRF attack detected error. I have tried to clear symfony and browser cache, deleted cookies, tried multiple browsers and multiple computers. What can cause this? When I turn off the CSRF protection it works fine. ...

Why does a multi-word Doctrine search cause MySQL to use up to 300% CPU?

I have a table using Doctrine's Searchable behaviour, which works well for single word queries. However I've noticed that when a query includes a space, the page hangs and I can't get any response out of refreshing the page etc. If I open Activity Monitor on my Mac, or SSH then 'top' in Ububntu, MySQL is running a process at up to 300% ...

[Doctrine] Query work under Unit tests, not when sent to Doctrine_Pager

I have this relation; Property hasMany Chargerate. Property has column 'default_price'. Chargerate has 'start_date', 'end_date' and 'price' columns. My query is like this: $q = PropertyTable::getInstance()->createQuery('p') ->select('p.*, ROUND(r.price) as cr_price) ->groupBy('p.id') ->leftJoin('p.Chargerate r WITH r.pr...

findBy relation field

class Profile { /** @OneToMany(targetEntity="Link", mappedBy="owner") */ private $links; } class Link { /** * @ManyToOne(targetEntity="Profile", inversedBy="links") * @JoinColumn(name="owner_id", referencedColumnName="id") */ public $owner; /** * @ManyToOne(targetEntity="Profile") * @JoinC...

What is the correct way to retrieve information from two tables using doctrine ORM.

I am trying to perform a simple join on two tables and am having trouble finding the right syntax to use - I know i am missing something simple. From the 'users' table i need the id (working fine) and from the 'meta' table i need the last_name (not working) $q = Doctrine_Query::create() ->from('Users u') ->leftJoin('u.Meta m'); $users...

How can you/Is it feasible to override Doctrine_Connection in Symfony?

The university servers I'm currently working on lack PDO drivers, hence I've had to re-implement PDO & it's respective MySQL class to allow doctrine to connect to a MySQL database. This is all well and good (or as well as a PHP implementation of PDO can go) and obviously if uni didn't have PDO at all this would all just work. However, ...

how to allow your code to store undetermined number of columns ?

Hi, I think my question might be unclear , but i would try to explain it by example . say that we had about 100 different car model , clearly all of the car would share common parts or specification but not all parts are shared between all of these 100 car brands what is the best practice of storing these specification in this case...

Doctrine ORM, two different querys produce the same result set

I'm using Doctrine 1.2 and Symfony 1.4. In my action, I have two different query that return different result set. Somehow the second query seem to change the result (or the reference?) of the first one and I don't have any clue why.. Here is an example: $this->categories = Doctrine_Query::create() ->from('Categorie AS c') ...

generate annotated doctrine2 entites from db schema

Is it possible to generate Doctrine 2 entities, with the relevant docblock annotations, from an existing database schema? ...