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 ?
...
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 ...
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,...
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...
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'=...
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.
...
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% ...
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...
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...
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...
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, ...
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...
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')
...
Is it possible to generate Doctrine 2 entities, with the relevant docblock annotations, from an existing database schema?
...