12 questions
3 votes
0 answers
327 views
How to use Doctrine 2 DQL ON to override default JOIN condition
For starters, it is NOT a duplicate of Doctrine 2 JOIN ON error. I am indeed getting Expected end of string, got 'ON' but using WITH won't solve my case. The problem there is similar but different ...
3 votes
2 answers
439 views
Escape a literal so that it is wrapped with double quotes
We use doctrine 2 and want to write parameterised code like this: attributes @> \'{' . $con->quote($attrId) . ':' . (int)$value . '}\''; to have a query like this: WHERE attributes @>'{"...
1 vote
1 answer
2k views
Doctrine 2.5 GUID field default value
I am trying to set a default value for an UUID type field /** * @var int * * @ORM\Column(name="uuid", type="guid", options={"default"="uuid_generate_v4()"}) * @ORM\Id() * @ORM\GeneratedValue(...
16 votes
1 answer
10k views
PostgreSQL index for like 'abc%' searching
I have postgreSQL table with city list (>1M) and I need to search over this table by pattern like 'abc%'. I created B-tree index on city.name column, and here is what i got: EXPLAIN SELECT * FROM ...
2 votes
1 answer
2k views
Postgres date_trunc(text, timestamp) with Doctrine 2 in Symfony?
How to use Postgres date_trunc(text, timestamp) function with Doctrine 2 in Symfony?
1 vote
1 answer
355 views
Simple DQL request using Doctrine2 & Postgresql
I want to use the query_builder in a Symfony2 FormType, I tried to make a simple request in my Postgresql shema using Doctrine DQL. It return me an error and i don't really understand how fix it : ...
1 vote
5 answers
8k views
Doctrine2 + Symfony2: Cast values before bind to DQL query
I'm building a function for filter some records based on four parameters: $codigo, $anno, $term and $comite_tecnico. This is what I build until now: public function filtrarNorma($codigo = null, $anno ...
2 votes
1 answer
139 views
symfony2 leftjoin condition on right - losing data
I have 3 entities . "Ejuridique" has 1 relation "onetomany" with . "Project" has 1 relation "onetomany" with . "Photo" When I do 1 query on "Ejuridique" and cascading left join on "Project" ...
5 votes
3 answers
3k views
schema update with doctrine2 postgresql always DROPs and then ADDs CONSTRAINTs
When updating schema, doctrine always drops and add constraints. I think, it is something wrong... php app/console doctrine:schema:update --force Updating database schema... Database schema updated ...
11 votes
1 answer
2k views
Doctrine ORM: Persisting collections with Composite Primary Keys composed of Foreign Keys
I'm guessing this is a Doctrine bug (and I've submitted an issue on JIRA issue tracker), but in case it's just user error I decided to post it here. SYNOPSIS Persisting a collection of entities in a ...
2 votes
2 answers
2k views
Cannot bind string value in Doctrine DBAL using bindValue, Postgresql
I'm trying to use Doctrine DBAL in my project; my database is Postgresql. This is a simple use case and I really do not know why is this not working. $query = "SELECT * FROM table ORDER BY field :...
1 vote
1 answer
5k views
An exception occurred while executing 'SELECT NEXTVAL('moneda_moneda_id_seq')':
im getting this error while trying to insert an entity in symfony2 with doctrine2, /** * Moneda * * @ORM\Table(name="moneda") * @ORM\Entity */ class Moneda { /** * @var integer *...