symfony-2.0

Symfony2: How to deploy in subdirectory (Apache)

落花浮王杯 提交于 2019-11-28 09:33:55
What is the best way to deploy symfony2 application in a subdirectory or an alias ? Lets say that my application will run under: http://domain/symfonytest symfonytest is an alias to some directory in my filesystem. Is there some CLI operation that I can use ? When I try to configure it manually I see a problem with routing. Requets to http://domain/symfonytest/demo are seen by router as /symfonytest/demo Is there a way to tell router to ignore /symfonytest prefix for the whole application ? meze If you are using Symfony < 2.3 you could follow this approach: Just add RewriteBase in your

Doctrine2 LEFT JOIN with 2 conditions

和自甴很熟 提交于 2019-11-28 07:22:03
问题 I'm trying to find a 'Product' by ID, and to left join all it's 'Photo' on two conditions: the locale AND the active state. Here's my QueryBuilder : $queryBuilder = $this->createQueryBuilder('p') ->select('p, photos, photoTranslation') ->leftJoin('p.photos', 'photos') ->leftJoin('photos.translations', 'photoTranslation') ->where('p.id = :id') ->andWhere('(photoTranslation.locale = :locale OR photoTranslation.locale IS NULL)') ->andWhere('(photoTranslation.active = :active OR photoTranslation

JMSSerializerBundle. no control over third party meta data

廉价感情. 提交于 2019-11-27 19:04:59
I have two entities I wish to serialize with the JMSSerializerBundle. The Music Entity has a mapping-file with exclusion_policy: NONE . The Music entity has a field of the entity User from FOSUserBundle . The User entity has a mapping-file with exclusion_policy: ALL with a few fields set to expose: true , so they will be serialized. The problem is, the User field gets fully serialized. It does not matter if I change the mapping-file of the User entity. This is how it looks: #My/Bundle/Resources/config/serializer/Entity.Music.yml xxx\xxx\Entity\Music: exclusion_policy: NONE #My/Bundle/Resources

JMSSerializerBundle. no control over third party meta data

本秂侑毒 提交于 2019-11-26 15:54:53
问题 I have two entities I wish to serialize with the JMSSerializerBundle. The Music Entity has a mapping-file with exclusion_policy: NONE . The Music entity has a field of the entity User from FOSUserBundle . The User entity has a mapping-file with exclusion_policy: ALL with a few fields set to expose: true , so they will be serialized. The problem is, the User field gets fully serialized. It does not matter if I change the mapping-file of the User entity. This is how it looks: #My/Bundle