0
votes
1answer
25 views

Symfony2 Embed form on multiple entities

I have 3 entities User class User extends BaseUser { /** * @ORM\OneToMany(targetEntity="UserPathologie", mappedBy="user") */ protected $userPathologies; } Pathologie class ...
0
votes
1answer
18 views

getResult() of TRUNCATE in Doctrine 2

What does Doctrine's getResult() function actually return when the issued query was a TRUNCATE TABLE statement? The API does not give me any answers. The code I'm running is this: $result = ...
1
vote
0answers
32 views

Error occurred while closing statement in dbal

In my silex web aplication I have this function: function obtener_visible($conn, $articulo, $wid) { $q= $conn ->prepare('call vn2008.article_visible_single(?, ?)'); ...
0
votes
2answers
23 views

Symfony2 sql query with DATE_SUB in hours

I want to get from database records from last 12 hours. I have this in my controler: $em = $this->getDoctrine()->getManager(); $query = $em->createQuery("SELECT e FROM ...
2
votes
1answer
31 views

Optional ManyToOne relationship in Doctrine 2

I'm building an application for SNMP Trap logging. It has two MySQL tables: one with the traps, and one with the hosts that I want to log. The traps table is filled externally. The hosts can be ...
0
votes
1answer
51 views

Symfony2, doctrine limit and offset doesn't work as expected

I'm trying to get results from my table using limit and offsett from my table, and this table has a relations with another two tables.. one of them is MayToOne and the other is OneToOne If I don't ...
0
votes
3answers
28 views

Persist Doctrine ArrayCollection with only strings to MySQL database

I'm persisting a field of type ArrayCollection to a MySQL database which contains only stings. The database field is of type "array" in the ORM definition and of type TEXT in the database. /** * ...
0
votes
0answers
41 views

Cannot connect to host's db from guest

In Ubuntu 12.04 guest on Windows 8.1 host (using VirtualBox), a cloned application cannot connect to the host's database. Regardless of settings in parameter.yml the following occurs at login: ...
0
votes
2answers
35 views

Too many TIME_WAIT from 127.0.0.1

I'm a noob for managing linux server. So if you reply please use simple words. Since 24H my server is very slow and my CPU is >100%, I'm regularly ddoss attack by script kiddies. So i put this cmd in ...
1
vote
1answer
33 views

Doctrine mysql, check if array in other array

I have in my database an array field. If i look i have that : a:3:{i:0;s:10:"23-09-2014";i:1;s:10:"24-09-2014";i:2;s:10:"01-10-2014";} In my controller, i create an other array from a string with : ...
0
votes
0answers
24 views

Software to create UI(s) to manage data in MySQL [closed]

I get frequent development requests from staff to develop "interface forms" to search, view and edit data in our MySQL database. At the moment I develop these in PHP/Symfony2 and lay out Datatables ...
0
votes
1answer
33 views

Symfony 2 - one source code, many databases

I have run into following issue. I have a Symfony 2.1 Application. It runs as two independent instances for two independent customers. The source code is exactly the same. Only the databases are ...
0
votes
1answer
35 views

Doctrine orWhere for multiple columns

I need to fetch using doctrine, my entity has three date values, expiryDate, scheduledDate, addedDate(mandatory). I need to check first is there any row having scheduledDate as today , If no then I ...
0
votes
1answer
32 views

How to structure account balance system

This is more of a theoretical question on how to structure a user accounting balance architecture. For the stack we are probably going to use Symfony with Doctrine, but I don't think that the language ...
1
vote
2answers
41 views

How can I use DATE() in Doctrine 2 DQL?

IN Symfony, when i used the following query with DATE function in the mysql i get a error SELECT employer.companyName AS employerName, jobs.jobId, jobs.industryId, jobs.focusId, ...
0
votes
2answers
19 views

Doctrine Update — Mysql Errno: 150

I have an issue while trying to update a table. I am trying to run the follow command: sudo -u www-data -H ./app/console doctrine:schema:update --dump-sql ALTER TABLE users ADD CONSTRAINT ...
0
votes
1answer
34 views

After using doctrine:schema:update --force

I'm using Symfony 2.1 on Windows 7, additionaly I'm using XAMPP. I had some problems with using commands like php app/console but now I do it like this c:/xampp/php/php.exe app/console because ...
0
votes
1answer
19 views

DQL Update multiple tables

I'm trying to update a row from some tables in one query. I've done: $this->getDoctrine()->getManager() ->createQuery(' UPDATE eo, tw FROM ...
0
votes
0answers
20 views

Unable to use field type “date” in composite unique key with Doctrine

I have Doctrine entity with a composite ID for stats entry like this: /** * @ORM\Table() * @ORM\Entity(repositoryClass="WA\CoreBundle\Entity\StatRepository") * */ class Stat { /** * @ORM\Id * ...
0
votes
2answers
21 views

Number of bound variables does not match number of tokens with query builder

I have the following query: ... $now = new \DateTime('now'); $now->setTime($now->format('H'), 0, 0); $shopsQueryBuilder = $this->createQueryBuilder('shops') ->select('shops.id, ...
0
votes
2answers
23 views

Results from a manyToOne, oneToMany association in Symfony2 not working

I am using symfony2 to build my web app but I cannot figure out why a query will not return results from two tables, just one. In my results I am only getting back the value from the SupplierPayment ...
1
vote
0answers
15 views

How to use Mysql Slave DB for SonataAdminBundle list & show pages?

I am using Symfony2 and SonataAdminBundle for my backend system. The data is gradually increasing which is slowing down my backend system. I have looked/searched for SonataAdminBundle optimization and ...
0
votes
1answer
45 views

DATEDIFF not working in Symfony2

I am not able to use datediff and Current_time in symfony2 repository .Same problem is there while i am using year function..why this happen? return $this->getEntityManager() ...
-1
votes
3answers
48 views

Special sorting for MySQL result

Is it possible to get MySQL to put a row which matches some condition on the first position? For instance, say that my result is [1, 3, 5, 6, 7, 1987] and I want it to become [6, 1, 3, 5, 7, 1987] (I ...
0
votes
0answers
15 views

MAMP PDO_MySql error with Zend2 and Doctrine2

I have propobly problem with PDO_MySql in my Zend2 & Doctrine project... This is my error, when i try use doctrine: http://wklej.to/PX5RW I use MAMP. This is my php.ini: http://wklej.to/DMUXi ...
-1
votes
0answers
42 views

Symfony2: Tables not showing in phpmyadmin after doctrine:schema:update

I have been having some problems with the set up of Symfony. I have posted on this in the last 2 days and to some extent have had some help. I believe this is a separate question. I am following ...
-1
votes
1answer
29 views

symfony2 isValid() method always returns true

I'm validating my data before saving them into the database, but so far, when javascript validation is turned off, i can't detect whether object is valid or not. Here is how I'm doing it: $editForm = ...
0
votes
1answer
30 views

Select all users where the last event is of type X

I am working with Symfony2 and Doctrine. My model includes users, that have transactions, and these transactions have some events with a date. So I have an entity class Users, an entity class ...
0
votes
1answer
27 views

Select data from many tables at the same time order by date (stream)

I want to get data from many tables with an order by created_at to make a stream. Tables: news, reviews, videos, games These all tables has created_at field. These data must be in an order with ...
0
votes
1answer
16 views

how just fetch 2 entity that related by some other entity to each other in Doctrine2

I think my question title is not clear enough so I place an example(symfony2 & Doctrine2): $query = $this->_em->createQuery( 'SELECT j, jp, po, p from MjJobBundle:Job j' ...
1
vote
0answers
54 views

doctrine2 oneToOne composite primary key not nullable

i've a problem with a composite primary key on a OneToOne relation in doctrine. When one object has no relation (which is normally possible) i got the following error message: ...
0
votes
1answer
14 views

DQL Allow Nullable Join?

In my entity 'Item', there is an ArrayCollection property known as "products" (of Entity 'Product') that can be empty I need all product info (empty or not) in one DQL call for the array of 'Item' ...
0
votes
1answer
17 views

Can I build entities in Symfony2 from an SQL DB schema?

I have an existing db modeled acording to my bussiness logic and i want to build up symfony2 entities from this db model. Is it possible? Here there are some facts: The reason why i start with the ...
0
votes
1answer
26 views

Doctrine returns result only with empty cache

Hi I'm doing a very simple query with Doctrine but it returns results only when I delete the cache : app/cache/ The problem is not Mysql because I get results with the query that Doctrine makes. I ...
5
votes
3answers
224 views

Formulating complicated Doctrine2 DQL query

Given I have an instance of Event ($event) that has many AttendancePerson, I need to get all of the AttendancePerson objects belonging to $event where the AttendancePerson.person attended more than ...
1
vote
1answer
31 views

symfony2 doctrine count number of joined entity

I have Article and Category Entity with manyToOne relation. I want to list categories with number of article in it. How can I query for it With Doctrine2 efficiently?
0
votes
0answers
12 views

Using Bootstrap DatePaginator in symfony2 with database dates

I`m developing a little application in symfony2 where I have a table with all date calendar and yours values and attributes, like bellow: | id | date ...
0
votes
1answer
45 views

Symfony2 + Doctrine Association Error: Class Game has no association named home

Here are the columns and rows of the MySQL tables: I'm trying to inner join the game.home and game.away with the Team.id, but i'm getting the error: "Error: Class ...
0
votes
1answer
56 views

Change primary key to auto increment

I updated my database schema in Doctrine 2 / Sf2 and added some new tables to my database. Everything was going okay, but when I wanted to create the admin side of the application I realized that I ...
0
votes
1answer
38 views

How to improve performace of LARGE imports using Doctrine 2

I have about 1 million records that i need to import. I have been looking all over the web for ways to improve and speed up this process. Currently my application connects to 1 database does a select ...
1
vote
0answers
20 views

Doctrine2 Persist two entities oneToMany bidirectional

i need to persist this entities but whenever i try to persist one of them, it told me that i need to persist the other, I tried the Cascade persistance from the inverse side but it didn't work. The ...
-1
votes
2answers
58 views

Fetch one Mysql row at a time in PHP Symfony

I have around 10000 records in a mysql table which has id, info and ip columns. ip columns are empty. I want to display one row at a time whenever the page refreshes. For every row displayed i want to ...
1
vote
2answers
51 views

Database schema for staff and customers [closed]

Firstly, I am creating a Database for support system using Symfony2 and Doctrine BUT i got confused which one is the best practice for schema of the customers, staff, roles Customer info: id, ...
1
vote
2answers
39 views

Not inserting duplicate items into MySQL DB - Doctrine and Symfony2

I am persisting some data from an API into a MySQL db using Symfony2 and Doctrine. I have an entity called Gig and I use annotations to set up the constraints. I think the relevant part of this looks ...
0
votes
1answer
25 views

Symfony2 custom doctrine request

I'm still having a problem which let me stop on working because I don't get it solved. I have 2 tables , Task and TaskDone. In Task there is stored the ID of the Task ( ID ) and the User, which the ...
0
votes
1answer
25 views

Connecting Symfony website to Amazon relational database

I am working on a symfony website and I want to connect it to a remote RDS on amazon on which i will be running some Select queries to fetch some data every time page refreshes. Is there an easy way ...
0
votes
0answers
26 views

Doctrine Query Builder and Left Join

I have this simple query : SELECT r.position, r.player_id, p.login FROM rankings AS r LEFT JOIN players AS p ON p.id = r.player_id I want to execute it with doctrine query ...
0
votes
1answer
23 views

Smyfony2 Comparing Data with existing data from other table

I output a list of task based on the current user. My Task Table looks like this: ID | Task Title | User | I also have a second table called "TaskDone" There I store when a task is marked as ...
0
votes
2answers
181 views

Dynamic Calculations based on underlying data

The story. I'm trying to calculate product cost's based on multiple varying factors. My system currently works perfectly using PHP functions however I would like to add some Ajax in order to produce ...
0
votes
1answer
15 views

Symfony 2.5 doctrine paginator does many selects fetching an relation

in symfony2.5 with doctrine2.x i try to set a paginator as described on the doctrine documentation I have a oneToOne relation between article and topten /** * Article * * ...