Re: [symfony-users] [s2][doctrine2] Update LifeCycleCallBack event not working [beta5]

2011-06-22 Thread Marco Pivetta
You should use Doctrine 2 Event listeners if you need access to the EntityManager. Usage of the EntityManager within entities themselves is STRONGLY discouraged, especially within Life-cycle Callbacks. Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 22 June 2011 18:32

Re: [symfony-users] Re: Learn Symfony2 or switch to Zend ?

2011-06-21 Thread Marco Pivetta
I'm still waiting for Zend Framework 2 MVC to start some new projects... The draft is really interesting, and if it is implemented well as it is defined... Well then Symfony 2 will be just part of my /lib for me :) I'm just waiting a couple of weeks more to see what is going on :D Marco Pivetta

Re: [symfony-users] Learn Symfony2 or switch to Zend ?

2011-06-20 Thread Marco Pivetta
Zend Framework 2's MVC still has to be implemented. You should really delay the debate ~3 weeks from today before taking any decision... Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 20 June 2011 17:00, Manu emmanuel.parf...@gmail.com wrote: My development team created

Re: [symfony-users] Symfony2 doctrine returns not UTF-8 from UTF-8 table

2011-06-17 Thread Marco Pivetta
Could you please check the encoding of your source files? Also check the content-encoding headers sent by your web server :) Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com 2011/6/16 Lajos Cseppentő cseppen...@gmail.com Hello everybody, My problem is the next: I am new

Re: [symfony-users] Re: Symfony and Facebook Hip Hop

2011-06-16 Thread Marco Pivetta
else before :) Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 16 June 2011 16:50, Tristan tristan.bessou...@gmail.com wrote: Someone asked a similar question during the sfLive. Fabien answer that symfony will not support HipHop as it does not speed-up a lot the website

Re: [symfony-users] Symfony 2 - Doctrine and inheritance

2011-06-14 Thread Marco Pivetta
just need to decide if you want to use an @MappedSuperclass or a single or joined table inheritance type :) Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 14 June 2011 14:47, Jérémy Simonklein jeremy.simonkl...@gmail.comwrote: Hi all, I would want to create 2 different

Re: [symfony-users] Fatal Error Class ....\Controller\DateTime' not found in Controller

2011-05-20 Thread Marco Pivetta
You just have to use it with the global namespace! Instead of *$d = new DateTime();* use *$d = new \DateTime();* //please note the initial '\', which means we're using a class from the global namespace :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 20

Re: [symfony-users] Performance

2011-05-19 Thread Marco Pivetta
You could use Xdebug and Cachegrind (or Webgrind) to check what's going wrong in there by profiling script execution times and used resources ;) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 19 May 2011 09:57, Laxmi laxmipsa...@gmail.com wrote: Hello, I

Re: [symfony-users] Entities passed to the choice field must be managed

2011-05-18 Thread Marco Pivetta
$myEntity = $entityManager-merge($entity); //does the job :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 18 May 2011 15:25, umpirsky umpir...@gmail.com wrote: I have a wizard of few steps. Each step manage separate doctrine entity, save it in session

Re: [symfony-users] Re: notice: serialize() __sleep

2011-05-17 Thread Marco Pivetta
only in step 1 (picker?) */ $modifiedUser = $em-getRepository('My\User')-findOneBy(array('fullname' = 'Marco Pivetta')); $em-detach($modifiedUser); $ns-user = $modifiedUser; request 2: $ns = new \Zend_Session_Namespace('test'); //Bringing my user entity back to life! $modifiedUser = $ns-user; $em

Re: [symfony-users] Testing Symfony2 Doctrine2 Entities against Database

2011-05-17 Thread Marco Pivetta
You should look at Doctrine\Common\Annotations\AnnotationReader#setAnnotationNamespaceAlias($namespace, $alias) That should do the job if you set $namespace = 'orm' and $alias = 'Doctrine\ORM\Mapping' Give it a try :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com

Re: [symfony-users] Re: notice: serialize() __sleep

2011-05-16 Thread Marco Pivetta
Careful! The entity manager's detach method does not return anything! Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 16 May 2011 08:55, oscar balladares liebegr...@gmail.com wrote: According what I have read so far, serialize/unserialize $entities

Re: [symfony-users] doctrine2 numRows

2011-05-16 Thread Marco Pivetta
Sergio, don't worry about the two queries. Even on MySQL it is OFTEN true that using SQL_CALC_FOUND_ROWS is slower than using two different queries. Don't really know why, but I suppose it has to do with internal optimization issues... Marco Pivetta @Ocramius http://twitter.com/Ocramius http

Re: [symfony-users] Annotations vs Yaml - which is recommended?

2011-05-13 Thread Marco Pivetta
, and if it's not cached, then you'll get SLOW processing with lots of parsing behind the scenes. I personally go for annotations, I like to see what references what directly in my classes, and with a well-configured cache I don't have any troubles :) Marco Pivetta @Ocramius http

Re: [symfony-users] doctrine2 numRows

2011-05-13 Thread Marco Pivetta
As far as I know, that is not supported by all vendors (see SQLite), thus not by Doctrine 2. You will have to add a COUNT() somewhere :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 13 May 2011 18:33, SergioAlbatronic sergio.pe...@albatronic.com wrote: Hi

Re: [symfony-users] ORM tutorials

2011-05-11 Thread Marco Pivetta
Well, did you try with http://www.doctrine-project.org/docs/orm/2.0/en/tutorials/getting-started-xml-edition.html? Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 10 May 2011 09:00, user123 zolzaya...@gmail.com wrote: Hi guys, I need a ORM tutorial. I'm coded

Re: [symfony-users] Re: notice: serialize() __sleep

2011-05-11 Thread Marco Pivetta
proxies! detach them from the entity manager first to get a clean POPO!) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 11 May 2011 01:10, Christophe COEVOET s...@notk.org wrote: Le 10/05/2011 13:25, AndyPI a écrit : Don't know if it helps, but changing my

Re: [symfony-users] ManyToMany self related

2011-05-11 Thread Marco Pivetta
though. You should really dive a bit in stuff like the ObjectHydrator and look at what it does :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 10 May 2011 19:14, Konrad Korzeniowski kon...@pandur.net wrote: Hello! Using symfony2 and doctrine I'm trying to build

Re: [symfony-users] [FORM] Multitple Entity type

2011-05-11 Thread Marco Pivetta
Did you define a ManyToOne owning side? Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 10 May 2011 21:35, Vincent Lechemin vincent.leche...@gmail.com wrote: Hi, I'm trying to use the entity type with a OneToMany relationship, but it's not working

Re: [symfony-users] Not a valid entity or mapped super class

2011-05-11 Thread Marco Pivetta
Could you expose the App\TestBundle\Entity\User class with annotations or related mapping? Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 11 May 2011 10:53, lidaa adilo...@gmail.com wrote: Hi all; I have the following error when I try to insert a new record

Re: [symfony-users] Dealing with VERY complex query

2011-05-04 Thread Marco Pivetta
SQL is way faster than PHP processing. I would really go for a filtered join. That's what SQL is there for :) Just be sure to filter by index and to return a limited resultset. Sequential scan in PHP has to be ABSOLUTELY avoided :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco

Re: [symfony-users] Dealing with VERY complex query

2011-05-04 Thread Marco Pivetta
Oh, sorry, forgot to mention that you should use the UNION syntax to fasten up this stuff a bit. Avoid using OR operator in queries, it almost destroys every attempt to use an index :) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 4 May 2011 12:21, Marco

Re: [symfony-users] Re: Symfony 2 and MSSQL

2011-05-04 Thread Marco Pivetta
Did you try with pdo_dblib? http://www.php.net/manual/en/ref.pdo-dblib.php Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 4 May 2011 13:07, apm korja...@gmail.com wrote: Which driver i must use for doctrine/mssql ? dbo_sqlsrv ?? I cant start this. always

Re: [symfony-users] Doctrine:generate:entities

2011-05-02 Thread Marco Pivetta
Entities are not generated by their setters or getters :) Please take some time to look at the Object Hydrator ;) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 30 April 2011 02:34, sergio sergio.pe...@albatronic.com wrote: Regarding doctrine:generate:entities

Re: [symfony-users] Doctrine2: custom entity repository error

2011-04-16 Thread Marco Pivetta
Just try *$repo = $em-getRepository('Vendor\MyBundle\Entity\User');* The EntityManager will resolve the correct EntityRepository for you ;) Marco Pivetta @Ocramius http://twitter.com/Ocramius http://marco-pivetta.com On 12 April 2011 17:02, Dmitry Bykadorov dmitry.bykado...@gmail.com wrote