Doctrine : many to many with a date of assignation in the refclass
residentSector: columns: id_resident_sector: type: integer primary: true autoincrement: true id_resident: type: integer(8) id: type: integer(8) date: type: timestamp residents: c...
residentSector: columns: id_resident_sector: type: integer primary: true autoincrement: true id_resident: type: integer(8) id: type: integer(8) date: type: timestamp residents: c...
Hey there I'm trying to find a way to check if some IDs are already in the DB, if an ID is already in the DB I'd naturally try to avoid processing the row it represents Right now I'm doing a single query to check for the ID, but I think this is too expensive in time because if I'm checking 20 id's the script is taking up to 30 seconds ...
Hi, I've got a MySQL 5.1.41 database which i'm trying to fill with doctrine, but doctrine does not insert the relations correctly. My YAML is: Locatie: connection: doctrine tableName: locatie columns: loc_id: type: integer(4) fixed: false unsigned: false primary: true autoincrement: true org_id: type: i...
I'm using Symfony 1.4 with Doctrine. Sorry if this is a silly question but what exactly does one need to build on top of the sfDoctrineGuardPlugin to get the "remember me" functionality working? When I login a user, the sfRemember cookie is created with the default 15-day lifetime, and the remember key is saved in the plugin's sf_guard...
how to acess user session in sfDoctrineRoute with symfony ? var_dump(sfContext::getInstance()->getUser()); returns NULL i cant access current user session in routing http://stackoverflow.com/questions/2455817/symfony-accessing-user-session-from-a-custom-routing-class = bad response ...
Hi, I'm using Symfony 1.2 with Doctrine. I have an object with the i18n behaviour. If I have the following validators, it fails when saving the form with error "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'id' cannot be null" (it tries to save the object_translation before saving the object) $this->validatorSchema['pho...
I'm using Symfony 1.4.4 and Doctrine and I need to upload an image on the server. I've done that hundreds of times without any problem but this time something weird happens : instead of the filename being stored in the database, I find the string "Array". Here's what I'm doing: In my Form: $this->useFields(array('filename')); $this->...
I want to make it so that anytime the db is queried for an sfGuardUserProfile it is autmoatically joined and hydrated with its related sfGuardUser. If i was using Propel 1.2 i would normally override the doSelectStmt method of the sfGuardUserProfilePeer class to inspect the Criteria and modify it as necessary as well as modifying the hy...
Hi all, I have a symfony form which have created_at and updated_at field for date. But I want to populate this field with default value and not shown when the form shows. So that, the created_at will hold the current time when inserting new data and updated_at will hold current date when updating any data. Did anyone do something like th...
I'm trying to create a query like this one : $q = Doctrine_Query::create() ->select('p.nombre') ->addSelect('(select count(*) from alojamiento a left join localidad l on a.localidad_id=l.id where p.id=l.provincia_id and a.activo=true)') ->from('provinc...
When I retrieve a record from the database which has a column of type "uniqueidentifier", Doctrine fills it with "null" rather than the unique id from the database. Some research and testing has brought this down to a PDO/dblib driver issue. When directly querying via PDO, null is returned in place of the unique id. For reference, htt...
When I manually hydrate or synchronize a record (for legacy integration reasons) and call ->exists() on the instance, it returns false. However, this record actually does exist. Is there some way to make Doctrine tell us the truth without having to execute another query? ...
when using doctrine i stumble upon these 2 words: accessor and mutator. are these only used in doctrine or are they specific for php? and what do they mean? thanks ...
Hi, I'm using Doctrine NestedSet behavior. I'd like to render the tree using php to <ul>'s and <li>'s Here's an example of what the output might be: <ul> <li>Node 1</li> <li>Node 2 <ul> <li>Child 1 of Node 2</li> <li>Child 2 of Node 2 <ul> <li>Another Child</li> ...
Hi, i have this code: $this->lista_miembros = $this->filtro->buildQuery($valores_query); var_dump($this->lista_miembros); var_dump outputs a Doctrine_Query object: object(Doctrine_Query)[121] protected '_subqueryAliases' => array I tried getSql() ... $q = Doctrine_Query::create() ->select('u.id') ->from('U...
I am beginning to work with Symfony, I've found some documentation about inheritance. But also found this discouraging article, which make me doubt if Doctrine handles inheritance any good at all... Has anyone find a smart solution for inheritance in Symfony+Doctrine? As an example, I have already structured the database something lik...
I have some extremely complex queries that I need to use to generate a report in my application. I'm using symfony as my framework and doctrine as my ORM. My question is this: What is the best way to pass in highly-complex sql queries directly to Doctrine without converting them to the Doctrine Query Language? I've been reading about ...
Using Doctrine in symfony 1.4 I have several boolean columns defined (stored as a tinyint in mySQL). The checkbox widgets are always rendering as checked, even when the returned value is '0'. It seems related to this ticket. Is this a common problem? Is there a workaround? I can get it working by changing line 70 in sfWidgetFormInputCh...
I have an array of default values that I'd like to merge with a Doctrine record. I tried using Doctrine's merge method but it's overwriting existing values with the merge array, even if the merge array contains null values. I'd like to merge in a way that only null or empty values are replaced with existing default values. ...
whenever i insert a entity that already exists in database (i have a unique constraint on email) i get an error message on the screen. so i want to check if it already exists, if not i insert it. at the moment it looks like this: $q = Doctrine_Query::create() ->from('User u') ->where('u.email = ?', $email); $object = $q->fetc...