[symfony-users] Re: [Sf2+MongoDB] predefine key for EmbedMany

2011-06-22 Thread Mathias
Sorry, lost the n: EmbedMany.

I don't use github. The code is just an short example to demonstrate
my problem.
The defined array_key won't get used by doctrine/symfony2 for mongodb.

Hope the example is clear enough...

On 21 Jun., 18:00, Luis Cordova cordo...@gmail.com wrote:
 EmbedMay? not clear, please if you have url on github provide it
 sounds interesting about day times and cache







 On Tue, Jun 21, 2011 at 9:45 AM, Mathias m.rohnst...@googlemail.com wrote:
  For example these Documents:

  pre
  class LocationCache
  {
     /**
      * @var array
      * @ODM\EmbedMany(targetDocument=test\TestBundle\Document
  \LocationCacheDays)
      */
     protected $days = array();

     /**
      * @param LocationCacheDays
      */
     public function setDays(LocationCacheDays $days)
     {
         $day = $days-getDay();
         $this-days = array_fill($day, 1, $days);
         // or: $this-days[$day] = $days;
         // will create the same resulting document
     }

     /**
      * @return array
      */
     public function getDays()
     {
         return $this-days;
     }

  }

  /**
   * @ODM\EmbeddedDocument
   */
  class LocationCacheDays
  {
      /**
       * @ODM\Int
       */
      protected $day;

      // Setter

      /**
       * @param int
       */
      public function setDay($day)
      {
         $this-day = $day;
      }

      // Getter

      /**
       * @return int
       */
      public function getDay()
      {
          return $this-day;
      }
  }
  /pre

  Here an example controller.
  pre
  $locationCache = new LocationCache();
  $locationCacheDay = new LocationCacheDays();
  $locationCacheDay-setDay(10);
  $locationCache-setDays($locationCacheDay);
  $dm-persist($locationCache);
  /pre

  The expacted Document should look like this:
  pre
  Array
  (
     [_id] = 4e00aa161c911abd4e01
     [days] = Array
         (
             [10] = Array
                 (
                     [day] = 10
                 )

         )

  )
  /pre

  but it will result in:
  pre
  Array
  (
     [_id] = 4e00aa161c911abd4e01
     [days] = Array
         (
             [0] = Array
                 (
                     [day] = 10
                 )

         )

  )
  /pre

  Is there a way to predefine the array_key in an EmbedMay-Document?

  Thanks in advance

  --
  If you want to report a vulnerability issue on symfony, please send it to 
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Symfony-2 Doctrine: Generateing realtions from annotaion

2011-06-22 Thread Kein
Yes, am trying to generate:entites - but it has no effect. Interesting 
that files entities/Products.php entites/Category.php was modifed with any 
generate:entites - but it's has no effect and i can't see any 
setter|getter for relation

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: file upload example?

2011-06-22 Thread Chris

In beta5 that problem I described is now solved, but there's another
one:
when preUpload() gets called, the field 'file' is not filled in
(reference: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html)
so I have no way to call  'file-guessExtension()'. Any idea??

 -- btw I am testing using (persisted) collections of file objects --


On Jun 15, 6:56 pm, Chris christophe.ben...@gmail.com wrote:
 Thanks for these, though I'm trying to implement multiple files
 upload: using a collection of a FileFormType that contains a file.
 I am now stuck at the bindrequest step.

 In my controller I loop through all the items in the ArrayCollection
 and do $files[$i]-upload() to mimick what's in that documentation.

 But there's a problem before that because bindRequest throws a
 tantrum:
   Expected argument of type array, string given
   500 Internal Server Error - UnexpectedTypeException

 Is there something different in the process here to upload a
 collection of files?

 On 14 juin, 07:55, Fabien Potencier fabien.potenc...@symfony-







 project.com wrote:
  On 6/11/11 12:24 PM, Ruben de Vries wrote:

   Are there any bundles on github that demonstrate a fileupload?

   I'm trying to implement handling the fileupload but I'm not really
   sure how to do it 'the symfony way'

   So some source code to dig through on github would be really helpfull
   (A)

 https://github.com/symfony/symfony-docs/blob/master/reference/forms/t...

 https://github.com/symfony/symfony-docs/blob/master/cookbook/doctrine...

  Fabien

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: Any chance of creating a new Google group for Symfony2 only?

2011-06-22 Thread Marcelo Prizmic
+1 split

2011/6/21 Jeremiah Dodds jeremiah.do...@gmail.com



 On Tue, Jun 21, 2011 at 12:02 PM, Luis Cordova cordo...@gmail.com wrote:

 splitting is counterproductive, we can always hit delete
 I myself hit a ton of deletes even with sf2 and I am for sf2, so i
 think people is having too thin of a skin.


 If you think the use of a 1.x branch of a popular web framework is going to
 die out shortly after the release of a BC-breaking 2.0 branch that shares a
 name, you are mistaken.

 Splitting the lists is a one-time effort, with a slope of minor annoyances
 for the users of it that trickles down to nil over the course of a few weeks
 to a month. Not splitting the list means everyone only interested in 1.x or
 2.x gets to sift through a bunch of noise, constantly.

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: file upload example?

2011-06-22 Thread oscar balladares
Have you try a postPersist event?

If that is working, and prePersist not, then you can use the postPersist. If
the fileupload returns an exception, then the persist
won't be commited anyway.

Also, on a postPersist event you have access to the Entity's id, which is
very useful for generating an unique name for the file.

On Jun 15, 6:56 pm, Chris christophe.ben...@gmail.com wrote:
  Thanks for these, though I'm trying to implement multiple files
  upload: using a collection of a FileFormType that contains a file.
  I am now stuck at the bindrequest step.
 
  In my controller I loop through all the items in the ArrayCollection
  and do $files[$i]-upload() to mimick what's in that documentation.
 
  But there's a problem before that because bindRequest throws a
  tantrum:
Expected argument of type array, string given
500 Internal Server Error - UnexpectedTypeException
 
  Is there something different in the process here to upload a
  collection of files?
 
  On 14 juin, 07:55, Fabien Potencier fabien.potenc...@symfony-
 
 
 
 
 
 
 
  project.com wrote:
   On 6/11/11 12:24 PM, Ruben de Vries wrote:
 
Are there any bundles on github that demonstrate a fileupload?
 
I'm trying to implement handling the fileupload but I'm not really
sure how to do it 'the symfony way'
 
So some source code to dig through on github would be really helpfull
(A)
 
  https://github.com/symfony/symfony-docs/blob/master/reference/forms/t.
 ..
 
  https://github.com/symfony/symfony-docs/blob/master/cookbook/doctrine.
 ..
 
   Fabien

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Exception throw UsernamePasswordToken

2011-06-22 Thread Michel Salib
Can you be more specific ?
Also can you show us your User class (and its relations) ?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Any chance of creating a new Google group for Symfony2 only?

2011-06-22 Thread Andras
+1

On jún. 22, 07:07, Fabien Potencier fabien.potenc...@symfony-
project.com wrote:
 On 6/21/11 5:49 PM, Luis Cordova wrote:

  don't fabien you will give more work to everybody
  as you said the problem will be only for few more months
  then sf1.x will die out and problem solved :)

 symfony1 is not going to die anytime soon. End of maintenance is end of
 2012; and people will continue to use it even after that. So, the end
 of life of symfony1 will probably be in 2015-2020, not sooner. At
 Sensio, we still have symfony 1.0 applications that won't be migrated to
 1.4 for instance. And that's fine.

 Fabien







  On Tue, Jun 21, 2011 at 9:58 AM, Jeremiah Dodds
  jeremiah.do...@gmail.com  wrote:

  2011/6/21 Fabien Potencierfabien.potenc...@symfony-project.com

  I've been thinking about this mailing-list issue a lot during the last few
  months and I'm still convinced that creating more mailing-lists is not the
  right solution. Anyway, as many people think the contrary, here is what I
  propose now:

  We create two new mailing-lists: one for symfony1 and one for Symfony2. To
  be clear, this mailing-list (symfony-users) will die. That way, there is 
  no
  legacy mailing-list, all symfony users will be treated the same way: 
  they
  will have to do something about their subscription.

  If everybody agree, I will start the migration and send invitations for
  all current subscribers.

  Cheers,
  Fabien

  + 1 . How do you feel about having the forums and mailing lists mirror each
  other via mail2forum or similar?

  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: Any chance of creating a new Google group for Symfony2 only?

2011-06-22 Thread David Buchmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

+1 for splitting into new lists

 As SF2 RC1 is about to be released, this is the perfect time to move to
 a new list.  The answers on that list are more likely to be correct to
 anyone searching the archives (prior to the API being stable, an answer
 could be correct one week and incorrect the next).

this is a very good argument indeed. i am constantly annoyed by finding
3 month old mailing list entries or blog posts that are just not true
anymore. starting with a fresh list that can be searched for answers
that are not obsolete sounds great.

cheers,david
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk4BpDgACgkQqBnXnqWBgIuzMACgyEToRWttFvvcGk4SbtTRPFzl
3lYAoKoJQxVYjBp2GHcfIsJOYthRVS6n
=dYny
-END PGP SIGNATURE-

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [Symfony2] Theming embedded form

2011-06-22 Thread Grégoire
Hi,

I'm currently working with addresses which are frequently reused through my 
application. That's why I would like to reuse the piece of forms that can 
render the Address related fields, so I decided to embed the AddressType 
form in other forms. Now I would like to customize theming for the Adress 
form (and sub-forms), is there a way to attach a template to a Form so it 
could be reused for theming each type it is embedded ? (So the render of the 
Adress part of the user forms would be the same as the Address part of a 
Bill for instance)

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Jobeet Day 5 - Problem with Homepage

2011-06-22 Thread Roy Raider
Hi all,

I have a problem with the end of the Day 5 on Jobeet.

When I have slugify the url for jobs, all works fine but the homepage
where i should have the list of jobs (who works before this action)
it's now a white page with only Paris, France write on.

I did the tutaurial twice, and I have always the same bug, someone
could help me ? =]

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] ./symfony propel:build-forms fails for plugins

2011-06-22 Thread Helloise Smit
 here is an excerpt of ./symfony propel:build-forms:


helloises@helloise:~/github_mira/rainbow_code/phoenix$ ./symfony
propel:build-forms --connection=PropelPDO
 propelgenerating form classes
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/TrafficChatForumTableForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/ContactSelectionForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/TrafficDemuxTableForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/transferCreditsForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/generateSendDates.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/TrafficContactTagTableForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/TrafficSlapSourceTableForm.class.php
 tokens
 /home/helloises/github_mira/rainbow_code/phoenix/lib/form/TrafficNodeTableForm.class.php

how come it does not build anything in /home/helloises/github_mira/
rainbow_code/phoenix/plugins/rainbowcodePlugins/lib/form ???

please help?
thank you

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] SF2: Missing hydrators for MongoDB

2011-06-22 Thread Adrien Mogenet
Hi everyone,

I was playing with Doctrine and MongoDB thanks to SF2, and I observed
that a configuration line was missing in your documentation.

doctrine_mongodb:
auto_generate_hydrator_classes: true

Otherwise, lots of things won't work properly...
Regards,

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: SF2: Missing hydrators for MongoDB

2011-06-22 Thread Adrien Mogenet
Or at least mention the generate:hydrators :)

On 22 juin, 12:12, Adrien Mogenet adrien.moge...@gmail.com wrote:
 Hi everyone,

 I was playing with Doctrine and MongoDB thanks to SF2, and I observed
 that a configuration line was missing in your documentation.

 doctrine_mongodb:
     auto_generate_hydrator_classes: true

 Otherwise, lots of things won't work properly...
 Regards,

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: sfForkedDoctrineApplyPlugin, several profiles, inheritance, sluggable behavior

2011-06-22 Thread Grzegorz Śliwiński
So...
It seems about right. Is sluggable field in the table in database?

On Jun 21, 6:53 pm, lucia aicul...@gmail.com wrote:
 Hi, thanks for your time, I have this:

 //Basemyprofile1
 $timestampable0 = new Doctrine_Template_Timestampable();
         $sluggable0 = new Doctrine_Template_Sluggable(array(
              'fields' =
              array(
               0 = 'name',
              ),
              'unique' = true,
              ));
         $this-actAs($timestampable0);
         $this-actAs($sluggable0);

 On 21 jun, 14:52, Grzegorz ¦liwiñski fi...@fizyk.net.pl wrote:



  hmmm... could you check your Basemyprofile1 or Basemyprofile2 classes
  if they include your behaviours?

  On Jun 20, 2:13 pm, lucia aicul...@gmail.com wrote:

   Hi,
   I followed the readme of the plugin, the problem is that when I
   rebuild model I lose behaviors,
   I have this model:
   myprofile1:
     inheritance:
       type: column_aggregation
       extends: sfGuardUserProfile
     actAs: { Timestampable: ~ , Sluggable:{ fields:[name], unique:
   true}}
     columns:
     
     relations:
     ...
   myprofile2:
     inheritance:
       type: column_aggregation
       extends: sfGuardUserProfile
     actAs: { Timestampable: ~ }
     columns:
     
     relations:
     ...
   I expected field called 'slug' , but no...
   Any idea? Maybe colision with inheritance? I changed the position of
   inheritance but the field slug doesn't
   appear..
   Does anyone know how I can fix this? The sluggable behavior is very
   important for myprofile1 table.
   On the other hand, can I use concrete inheritance with this plugin?
   Thanks a lot
   PS: I'm sorry for my English- Ocultar texto de la cita -

  - Mostrar texto de la cita -

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: sfForkedDoctrineApplyPlugin, several profiles, inheritance, sluggable behavior

2011-06-22 Thread lucia
No, it isn't

On 22 jun, 15:13, Grzegorz Śliwiński fi...@fizyk.net.pl wrote:
 So...
 It seems about right. Is sluggable field in the table in database?

 On Jun 21, 6:53 pm, lucia aicul...@gmail.com wrote:



  Hi, thanks for your time, I have this:

  //Basemyprofile1
  $timestampable0 = new Doctrine_Template_Timestampable();
          $sluggable0 = new Doctrine_Template_Sluggable(array(
               'fields' =
               array(
                0 = 'name',
               ),
               'unique' = true,
               ));
          $this-actAs($timestampable0);
          $this-actAs($sluggable0);

  On 21 jun, 14:52, Grzegorz ¦liwiñski fi...@fizyk.net.pl wrote:

   hmmm... could you check your Basemyprofile1 or Basemyprofile2 classes
   if they include your behaviours?

   On Jun 20, 2:13 pm, lucia aicul...@gmail.com wrote:

Hi,
I followed the readme of the plugin, the problem is that when I
rebuild model I lose behaviors,
I have this model:
myprofile1:
  inheritance:
    type: column_aggregation
    extends: sfGuardUserProfile
  actAs: { Timestampable: ~ , Sluggable:{ fields:[name], unique:
true}}
  columns:
  
  relations:
  ...
myprofile2:
  inheritance:
    type: column_aggregation
    extends: sfGuardUserProfile
  actAs: { Timestampable: ~ }
  columns:
  
  relations:
  ...
I expected field called 'slug' , but no...
Any idea? Maybe colision with inheritance? I changed the position of
inheritance but the field slug doesn't
appear..
Does anyone know how I can fix this? The sluggable behavior is very
important for myprofile1 table.
On the other hand, can I use concrete inheritance with this plugin?
Thanks a lot
PS: I'm sorry for my English- Ocultar texto de la cita -

   - Mostrar texto de la cita -- Ocultar texto de la cita -

 - Mostrar texto de la cita -

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


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

2011-06-22 Thread Marcelo Prizmic
Oscar

Thanks for the example!!

Did you use entity manager in the uploadFile()?

In my case I would need to make some queries inside the preEvent function.
Do you know how?

Marcelo

2011/6/21 oscar balladares liebegr...@gmail.com

 Hi Marcelo; yes, of course:

 I'm currently using YML config instead of Annotations. I do really love to
 separate metadata from Entities classes.

 You have to tell doctrine to enable LifeCycleCallback event like this:

 Oscar\HotelBundle\Entity\Foto:
 type:  entity
 table:  foto
 repositoryClass: Oscar\HotelBundle\Repo\FotoRepo
 id:
 id:
 type:  integer
 generator:
 strategy:  AUTO
 fields:
 titulo:
 type:  string
 length: 100
  notnull: false

 *lifecycleCallbacks:*
 *postPersist: [ uploadFile ]*


 So you should have an uploadFile() method defined in the entity's class.

 When you call $em-flush() Doctrine will look for events prior or post
 flushing. (prePersist, postPersist, preUpdate, postUpdate, preRemove,
 postRemove)

 Class Foto
 {
 //private properties

 //public getters and setters

 public function uploadFile()
 {
   //this is invoked after this entity is persisted.
 }

 }

 In my case, every event is invoked properly, but preUpdate nor postUpdate;
 If I would have misstyped prePersist: [ uploadFil*eIMisstypedThis* ]
 the framework will thrown an exception telling me that such method doesn't
 exist in the entity class; if I do the same for preUpdate, or postUpdate,
 it will be ignored, like it doesn't check the method.

 Regards!

 2011/6/20 Marcelo Prizmic mpriz...@gmail.com

 Hi Oscar
 Could you post some code about how to use per or post events?
 Thanks
 Marcelo


 2011/6/20 oscar balladares liebegr...@gmail.com

 Hi everybody!.

 I'm using Yaml configuration for doctrine metadata.

 All others events (prePersist, postPersist, preRemove, postRemove) are
 working properly, but not the preUpdate and PostUpdate.

 Of course, I'm just calling the 'persist' method of the $EntityManager:

 $em-persist($AlreadyInDatabaseEntityInstance);
 $em-flush();

 The row in the database is updated actually, but the method is never
 called.

 the easiest way to prove myself I'm not crazy, is that if the method name
 that has been set in the metadata is not correct,
 then when the Event is called, an exception will be thrown, i.e:

 preRemove: [ preRemoveMethod ]

 then I: $em-remove($entity)

 If the preRemoveMethod doesn't exist in the Entity class, then an
 excepetion will be trhown.
 In the other hand, preUpdate/postUpdate will be ignored completely. I
 can:

 preUpdate: [ asdfasdfaThisMethodDoesNotExistInTheEntityClassaesrseres ]

 No exception will be thrown, knowing that such method doesn't exist at
 all.

 (It won't happen with any other event).

 What could be wrong?

 Regards!

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [sf2] thinking of putting together a seed data bundle

2011-06-22 Thread theinterned
Hi,

I am looking around for a solution to load seed data into my project.
Until now, I have been using fixtures to load the data, but of course
this gets very dangerous when you have live, non static data on your
production server!

In the rails world, there is Seed Fu https://github.com/mbleigh/seed-fu
and I am thinking of building out a seed data bundle for symfony along
the same lines. (and here is a good rails-centric discussion of
various seeding strategies and their downfalls:
http://railspikes.com/2008/2/1/loading-seed-data)

It seems to me that I could get a long way by branching off the
doctrine fixtures bundle. I would need to get rid of the parts of it
that are involved with dropping data and change the data loading to do
insert or update rather then just insert.

I'm wondering if anyone would be interested in the bundle, would be
interested in helping out?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [sf2] thinking of putting together a seed data bundle

2011-06-22 Thread Tac Tacelosky
+1 for interest.  Not sure if I can contribute much to the development --
still getting my head around bundles, src, vendors and third_party, and how
all this will fit into svn (my code) and git (Symfony SE / Symfony /
Vendors).  But I like the idea -- we're porting from CodeIgniter, and right
now have a YAML file that I load to seed the initial data, mostly user login
accounts and profiles, so they don't have to re-register every time we
release a new test.

Will you keep it on symfony2bundles?  And don't worry about dumbing-down the
instructions, newbies like me appreciate it.  Even things like Don't forget
to add this to the routing can take a while to remember how exactly do to.

Tac

On Wed, Jun 22, 2011 at 11:41 AM, theinterned ned...@gmail.com wrote:

 Hi,

 I am looking around for a solution to load seed data into my project.
 Until now, I have been using fixtures to load the data, but of course
 this gets very dangerous when you have live, non static data on your
 production server!

 In the rails world, there is Seed Fu https://github.com/mbleigh/seed-fu
 and I am thinking of building out a seed data bundle for symfony along
 the same lines. (and here is a good rails-centric discussion of
 various seeding strategies and their downfalls:
 http://railspikes.com/2008/2/1/loading-seed-data)

 It seems to me that I could get a long way by branching off the
 doctrine fixtures bundle. I would need to get rid of the parts of it
 that are involved with dropping data and change the data loading to do
 insert or update rather then just insert.

 I'm wondering if anyone would be interested in the bundle, would be
 interested in helping out?

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re : Re: Using 3rd party libraries (eg PHPExcel) with Symfony2

2011-06-22 Thread Jérôme P .
Dear Jake,

I also have some difficulties using PHPExcel in Symfony2. Would you mind 
sharing the code you used for the autoload and a quick example of use?

Thanks,
Jerom

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Using 3rd party libraries (eg PHPExcel) with Symfony2

2011-06-22 Thread Jérôme P .
Hi Jake,

I also have some difficulties to register properly PHPExcel
librairy :/
Would you mind sharing the code you use for the autoload and a quick
example of use?

Thanks,
Jerome

On 20 juin, 15:05, Jake jakewbis...@googlemail.com wrote:
 Thanks... i put it in the vendor folder and registered a prefix with
 the autoloader. works!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [Symfony2] problem when using PHP Template following the Page Creation documentation

2011-06-22 Thread WebDevPT
Hi, perhaps I'm wrong but following the steps from the 
http://symfony.com/doc/current/book/page_creation.html and using the PHP 
render option leads me to no template at all with just echoed chars.

I used the twig template option using the proper render at

*// src/Acme/HelloBundle/Controller/HelloController.php*
return $this-render('AcmeHelloBundle:Hello:index.html.twig', array('name' 
= $name));

and everything goes ok, but when i switch to this:

*// src/Acme/HelloBundle/Controller/HelloController.php*
return $this-render('AcmeHelloBundle:Hello:index.html.php', array('name' = 
$name));

I get this on the browser when opening the Hello page:
*
extend('::layout.html.php') ? Hello escape($name) ?!*

I followed the steps at the Page Creation documentation, I believe that this 
is just a lack of brackets or something like that, and I will look into it 
later but someone else had this issue? If this is a lack or missing brackets 
it should be corrected on the Page Creation documentation. I'm still 
trying to learn Symfony, but this can be a simple PHP missing char 
somewhere, and I'm still trying to figure out how all this works.

PS - Running on a WAMP environment

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Jobeet Day 5 - Problem with Homepage

2011-06-22 Thread oscar balladares
Do you have it on a github repository? It would be great if you do.
Not being able to see your code is a huge backdraw. I'm 99.99% that is a
problem with your code, so
we need to see it to figure out what is happening.

But, you can post all your code from day 4, and day 5 here to take a look at
it.

Regards!

2011/6/22 Roy Raider anthony.auber...@gmail.com

 Hi all,

 I have a problem with the end of the Day 5 on Jobeet.

 When I have slugify the url for jobs, all works fine but the homepage
 where i should have the list of jobs (who works before this action)
 it's now a white page with only Paris, France write on.

 I did the tutaurial twice, and I have always the same bug, someone
 could help me ? =]

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [symfony2] What is the best way to handle URLs in javascript files called by assetic

2011-06-22 Thread oscar balladares
If you are calling another pages within a href tag, but using JS (i.e ajax
request)
you can get the link's url:

 $('#a-link').click(function(e){
var $url = $(this).attr('href');
$(this).preventDefault;
//request content based on the url, with ajax.
});

If it is not a request, you could use a dirty trick: setting your urls on
hidden fields, and reading its values with JQuery.

:D

Regards!

2011/6/22 Jake jakewbis...@googlemail.com

 I am using assetic in a twig template to include a javascript file
 from my bundle's public folder.
 The problem is this JS file has URLs in it to call other pages using
 jQuery.
 How should i handle these URLs? I could write the URLs as absolute
 paths - but this causes problems between the dev and prod environment,
 and also makes the application not very portable.
 What is the best way to do such things?

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: [Symfony2] [Solved] problem when using PHP Template following the Page Creation documentation

2011-06-22 Thread WebDevPT
Never mind, after reading the whole page i noticed that at the end there was 
another link to this topic:

*How to use PHP instead of Twig for Templates*
http://symfony.com/doc/current/cookbook/templating/PHP.html

I simply had to change my configuration file and add this

# app/config/config.ymlframework:
# ...
*templating:{ engines: ['twig', 'php'] **}*

Now my apps can use both twig and php template engines.


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [symfony2] What is the best way to handle URLs in javascript files called by assetic

2011-06-22 Thread oscar balladares
I meant : 'if it is not a link-for-ajax-purpose, then you can use hidden
fields'.

2011/6/22 oscar balladares liebegr...@gmail.com

 If you are calling another pages within a href tag, but using JS (i.e
 ajax request)
 you can get the link's url:

  $('#a-link').click(function(e){
 var $url = $(this).attr('href');
 $(this).preventDefault;
 //request content based on the url, with ajax.
 });

 If it is not a request, you could use a dirty trick: setting your urls on
 hidden fields, and reading its values with JQuery.

 :D

 Regards!

 2011/6/22 Jake jakewbis...@googlemail.com

 I am using assetic in a twig template to include a javascript file
 from my bundle's public folder.
 The problem is this JS file has URLs in it to call other pages using
 jQuery.
 How should i handle these URLs? I could write the URLs as absolute
 paths - but this causes problems between the dev and prod environment,
 and also makes the application not very portable.
 What is the best way to do such things?

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en




-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [sf2] thinking of putting together a seed data bundle

2011-06-22 Thread oscar balladares
+1. It sounds great! Sadly, I'm very busy at the time, so I can't help right
now :(

2011/6/22 Tac Tacelosky tac...@gmail.com

 +1 for interest.  Not sure if I can contribute much to the development --
 still getting my head around bundles, src, vendors and third_party, and how
 all this will fit into svn (my code) and git (Symfony SE / Symfony /
 Vendors).  But I like the idea -- we're porting from CodeIgniter, and right
 now have a YAML file that I load to seed the initial data, mostly user login
 accounts and profiles, so they don't have to re-register every time we
 release a new test.

 Will you keep it on symfony2bundles?  And don't worry about dumbing-down
 the instructions, newbies like me appreciate it.  Even things like Don't
 forget to add this to the routing can take a while to remember how exactly
 do to.

 Tac


 On Wed, Jun 22, 2011 at 11:41 AM, theinterned ned...@gmail.com wrote:

 Hi,

 I am looking around for a solution to load seed data into my project.
 Until now, I have been using fixtures to load the data, but of course
 this gets very dangerous when you have live, non static data on your
 production server!

 In the rails world, there is Seed Fu https://github.com/mbleigh/seed-fu
 and I am thinking of building out a seed data bundle for symfony along
 the same lines. (and here is a good rails-centric discussion of
 various seeding strategies and their downfalls:
 http://railspikes.com/2008/2/1/loading-seed-data)

 It seems to me that I could get a long way by branching off the
 doctrine fixtures bundle. I would need to get rid of the parts of it
 that are involved with dropping data and change the data loading to do
 insert or update rather then just insert.

 I'm wondering if anyone would be interested in the bundle, would be
 interested in helping out?

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


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

2011-06-22 Thread oscar balladares
I Marcelo. I have not tried to use the EM, but as far as I know, it is not
available in the Entity's scope, I will try to find out if this is correct,
because I'm interested in atomic queries.

Regards!

2011/6/22 Marcelo Prizmic mpriz...@gmail.com

 Oscar

 Thanks for the example!!

 Did you use entity manager in the uploadFile()?

 In my case I would need to make some queries inside the preEvent
 function. Do you know how?

 Marcelo


 2011/6/21 oscar balladares liebegr...@gmail.com

 Hi Marcelo; yes, of course:

 I'm currently using YML config instead of Annotations. I do really love to
 separate metadata from Entities classes.

 You have to tell doctrine to enable LifeCycleCallback event like this:

 Oscar\HotelBundle\Entity\Foto:
 type:  entity
 table:  foto
 repositoryClass: Oscar\HotelBundle\Repo\FotoRepo
 id:
 id:
 type:  integer
 generator:
 strategy:  AUTO
 fields:
 titulo:
 type:  string
 length: 100
  notnull: false

 *lifecycleCallbacks:*
 *postPersist: [ uploadFile ]*


 So you should have an uploadFile() method defined in the entity's class.

 When you call $em-flush() Doctrine will look for events prior or post
 flushing. (prePersist, postPersist, preUpdate, postUpdate, preRemove,
 postRemove)

 Class Foto
 {
 //private properties

 //public getters and setters

 public function uploadFile()
 {
   //this is invoked after this entity is persisted.
 }

 }

 In my case, every event is invoked properly, but preUpdate nor postUpdate;
 If I would have misstyped prePersist: [ uploadFil*eIMisstypedThis* ]
 the framework will thrown an exception telling me that such method doesn't
 exist in the entity class; if I do the same for preUpdate, or postUpdate,
 it will be ignored, like it doesn't check the method.

 Regards!

 2011/6/20 Marcelo Prizmic mpriz...@gmail.com

 Hi Oscar
 Could you post some code about how to use per or post events?
 Thanks
 Marcelo


 2011/6/20 oscar balladares liebegr...@gmail.com

 Hi everybody!.

 I'm using Yaml configuration for doctrine metadata.

 All others events (prePersist, postPersist, preRemove, postRemove) are
 working properly, but not the preUpdate and PostUpdate.

 Of course, I'm just calling the 'persist' method of the $EntityManager:

 $em-persist($AlreadyInDatabaseEntityInstance);
 $em-flush();

 The row in the database is updated actually, but the method is never
 called.

 the easiest way to prove myself I'm not crazy, is that if the method
 name that has been set in the metadata is not correct,
 then when the Event is called, an exception will be thrown, i.e:

 preRemove: [ preRemoveMethod ]

 then I: $em-remove($entity)

 If the preRemoveMethod doesn't exist in the Entity class, then an
 excepetion will be trhown.
 In the other hand, preUpdate/postUpdate will be ignored completely. I
 can:

 preUpdate: [ asdfasdfaThisMethodDoesNotExistInTheEntityClassaesrseres ]

 No exception will be thrown, knowing that such method doesn't exist at
 all.

 (It won't happen with any other event).

 What could be wrong?

 Regards!

 --
 If you want to report a vulnerability issue on symfony, please send it
 to security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en



Re: [symfony-users] [sf2] thinking of putting together a seed data bundle

2011-06-22 Thread Jeremiah Dodds
On Wed, Jun 22, 2011 at 11:41 AM, theinterned ned...@gmail.com wrote:

 Hi,

 I am looking around for a solution to load seed data into my project.
 Until now, I have been using fixtures to load the data, but of course
 this gets very dangerous when you have live, non static data on your
 production server!

 In the rails world, there is Seed Fu https://github.com/mbleigh/seed-fu
 and I am thinking of building out a seed data bundle for symfony along
 the same lines. (and here is a good rails-centric discussion of
 various seeding strategies and their downfalls:
 http://railspikes.com/2008/2/1/loading-seed-data)

 It seems to me that I could get a long way by branching off the
 doctrine fixtures bundle. I would need to get rid of the parts of it
 that are involved with dropping data and change the data loading to do
 insert or update rather then just insert.

 I'm wondering if anyone would be interested in the bundle, would be
 interested in helping out?


huge +1, i might be able to throw a pull request your way here and there,
but can't promise anything at the moment, crunchtime and all that :/

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


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, oscar balladares liebegr...@gmail.com wrote:

 I Marcelo. I have not tried to use the EM, but as far as I know, it is not
 available in the Entity's scope, I will try to find out if this is correct,
 because I'm interested in atomic queries.

 Regards!


 2011/6/22 Marcelo Prizmic mpriz...@gmail.com

 Oscar

 Thanks for the example!!

 Did you use entity manager in the uploadFile()?

 In my case I would need to make some queries inside the preEvent
 function. Do you know how?

 Marcelo


 2011/6/21 oscar balladares liebegr...@gmail.com

 Hi Marcelo; yes, of course:

 I'm currently using YML config instead of Annotations. I do really love
 to separate metadata from Entities classes.

 You have to tell doctrine to enable LifeCycleCallback event like this:

 Oscar\HotelBundle\Entity\Foto:
 type:  entity
 table:  foto
 repositoryClass: Oscar\HotelBundle\Repo\FotoRepo
 id:
 id:
 type:  integer
 generator:
 strategy:  AUTO
 fields:
 titulo:
 type:  string
 length: 100
  notnull: false

 *lifecycleCallbacks:*
 *postPersist: [ uploadFile ]*


 So you should have an uploadFile() method defined in the entity's class.

 When you call $em-flush() Doctrine will look for events prior or post
 flushing. (prePersist, postPersist, preUpdate, postUpdate, preRemove,
 postRemove)

 Class Foto
 {
 //private properties

 //public getters and setters

 public function uploadFile()
 {
   //this is invoked after this entity is persisted.
 }

 }

 In my case, every event is invoked properly, but preUpdate nor
 postUpdate; If I would have misstyped prePersist: [ uploadFil*
 eIMisstypedThis* ]
 the framework will thrown an exception telling me that such method
 doesn't exist in the entity class; if I do the same for preUpdate, or
 postUpdate,
 it will be ignored, like it doesn't check the method.

 Regards!

 2011/6/20 Marcelo Prizmic mpriz...@gmail.com

 Hi Oscar
 Could you post some code about how to use per or post events?
 Thanks
 Marcelo


 2011/6/20 oscar balladares liebegr...@gmail.com

 Hi everybody!.

 I'm using Yaml configuration for doctrine metadata.

 All others events (prePersist, postPersist, preRemove, postRemove) are
 working properly, but not the preUpdate and PostUpdate.

 Of course, I'm just calling the 'persist' method of the $EntityManager:

 $em-persist($AlreadyInDatabaseEntityInstance);
 $em-flush();

 The row in the database is updated actually, but the method is never
 called.

 the easiest way to prove myself I'm not crazy, is that if the method
 name that has been set in the metadata is not correct,
 then when the Event is called, an exception will be thrown, i.e:

 preRemove: [ preRemoveMethod ]

 then I: $em-remove($entity)

 If the preRemoveMethod doesn't exist in the Entity class, then an
 excepetion will be trhown.
 In the other hand, preUpdate/postUpdate will be ignored completely. I
 can:

 preUpdate: [ asdfasdfaThisMethodDoesNotExistInTheEntityClassaesrseres ]

 No exception will be thrown, knowing that such method doesn't exist at
 all.

 (It won't happen with any other event).

 What could be wrong?

 Regards!

 --
 If you want to report a vulnerability issue on symfony, please send it
 to security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it
 to security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 

Re: [symfony-users] Symfony-2 Doctrine: Generateing realtions from annotaion

2011-06-22 Thread Kein
I forget how, but i solve problem after many attemps.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Security - UserProvider with Web Service - Get the password

2011-06-22 Thread Filipe La Ruina
I got the same problem.
I have to curl an service passing username and password. It will return me a 
cookie corresponding to the user session.
Any thoughts on how to do that?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] About cache:clear command

2011-06-22 Thread Ozzy
Hi,

I wonder what is the difference between app/console cache:clear and
rm -rf app/cache/* commands. When I use the first one, I sometimes
get errors in the web application, so I use the second one. But, what
is the exact difference?

Thanks.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] About cache:clear command

2011-06-22 Thread Christophe COEVOET

Le 22/06/2011 22:59, Ozzy a écrit :

Hi,

I wonder what is the difference between app/console cache:clear and
rm -rf app/cache/* commands. When I use the first one, I sometimes
get errors in the web application, so I use the second one. But, what
is the exact difference?

Thanks.

The first one only removes the cache for the current environment (the 
console runs in dev by default and this can be changed using the /--env/ 
option).
The second difference is that the first command also warmps up the cache 
after clearing it.


--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] [Symfony 2] Is there anyone working on a bundle for backup - restore databases?

2011-06-22 Thread Gustavo Adrian
Hi everyone,

As far as I know, the best way to backup/restore a database is using the
utility each db vendor provides for such a task. That's why I've started to
work today in a bundle that provides a way to execute these utilities within
symfony's environment. I had it working some time ago, but only for MySQL.
Now I want to create a bundle with the possibility of adding the needed
classes to handle other vendor's utilities. It's a simple bundle with some
classes responsibles of doing the backup / restore using the information of
some Doctrine's connection. It provides Commands for backup and restore too.
For now I'll only implement classes to handle MySQL's mysqldump. I need
support for MongoDB too, but I still don't know much about how to do a
backup / restore with this db so I'll have to read a little bit about it
first.

I guess I'll be uploading this bundle tomorrow at work, but in the meantime
I'd like to know if anyone is working on something like this. If not, any
comments about this topic will be very appreciated.



Thanks in advance!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [Symfony 2] Is there anyone working on a bundle for backup - restore databases?

2011-06-22 Thread oscar balladares
+1 It would a very nice utility. I'm pretty sure it will catch community
attention.

Does It will be like the admin bundle? with a GUI for such task? Does it
would have a command-line utility?

Regards!

2011/6/22 Gustavo Adrian comfortablynum...@gmail.com

 Hi everyone,

 As far as I know, the best way to backup/restore a database is using the
 utility each db vendor provides for such a task. That's why I've started to
 work today in a bundle that provides a way to execute these utilities within
 symfony's environment. I had it working some time ago, but only for MySQL.
 Now I want to create a bundle with the possibility of adding the needed
 classes to handle other vendor's utilities. It's a simple bundle with some
 classes responsibles of doing the backup / restore using the information of
 some Doctrine's connection. It provides Commands for backup and restore too.
 For now I'll only implement classes to handle MySQL's mysqldump. I need
 support for MongoDB too, but I still don't know much about how to do a
 backup / restore with this db so I'll have to read a little bit about it
 first.

 I guess I'll be uploading this bundle tomorrow at work, but in the meantime
 I'd like to know if anyone is working on something like this. If not, any
 comments about this topic will be very appreciated.



 Thanks in advance!

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] [Symfony 2] Is there anyone working on a bundle for backup - restore databases?

2011-06-22 Thread Gustavo Adrian
For now it's a very simple bundle with a couple of classes that handles the
call to the db vendor's utility that corresponds to the connection you use
(for now only MySQL), using the connection's parameters. It has console
commands too that uses those classes. You can simply run the backup with
something like:

$factory = $container-get('backup_restore.factory');
$backupInstance =
$factory-getBackupInstance('my_mysql_connection_service_id');   // This
gets a Backup instance for the db platform of the connection. In this case,
MySQL

$pathToGeneratedSqlFile = $backupInstance-backupDatabase('/target/dir',
'optional_file_name.sql');

I was working on this for my app, but I decided to create a more generic
bundle in case anyone is interested in using it (or extend it). Sadly, it
hasn't a GUI because I needed only the classes that handle the work and some
commands to run them. I'll upload it tomorrow to github.

I didn't found a better way to handle backup / restore functionalities
within PHP than executing the DB vendor's utilities (such as mysqldump).
If anyone has a better way for backup / restore handling, please let me
know.



Thanks!

2011/6/22 oscar balladares liebegr...@gmail.com

 +1 It would a very nice utility. I'm pretty sure it will catch community
 attention.

 Does It will be like the admin bundle? with a GUI for such task? Does it
 would have a command-line utility?

 Regards!

 2011/6/22 Gustavo Adrian comfortablynum...@gmail.com

 Hi everyone,

 As far as I know, the best way to backup/restore a database is using the
 utility each db vendor provides for such a task. That's why I've started to
 work today in a bundle that provides a way to execute these utilities within
 symfony's environment. I had it working some time ago, but only for MySQL.
 Now I want to create a bundle with the possibility of adding the needed
 classes to handle other vendor's utilities. It's a simple bundle with some
 classes responsibles of doing the backup / restore using the information of
 some Doctrine's connection. It provides Commands for backup and restore too.
 For now I'll only implement classes to handle MySQL's mysqldump. I need
 support for MongoDB too, but I still don't know much about how to do a
 backup / restore with this db so I'll have to read a little bit about it
 first.

 I guess I'll be uploading this bundle tomorrow at work, but in the
 meantime I'd like to know if anyone is working on something like this. If
 not, any comments about this topic will be very appreciated.



 Thanks in advance!

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


  --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Name conflicts in Twig blocks

2011-06-22 Thread Kevin
Hey all,
I'm integrating the FOS UserBundle (many thanks to the bundle developers, 
btw) into an application, and I'm trying to find the cleanest way to 
integrate the bundle templates stylistically.

We have a base template that looks something like:

{# MyBundle::base.html.twig #}
...
{% block body %}
...
div id='content'
{% block content %}
{% endblock %}
/div
{% endblock %}
...

For most of the user bundle templates, the default content is fine for our 
purposes, so my first thought would just be to override 
FOSUserBundle::layout.html.twig (which all the user bundle templates extend 
from) with something extending our base template.  However, I'd like the 
final result to look something like:

{# Overrides FOSUserBundle::layout.html.twig #}
{% extends 'MyBundle::base.html.twig %}
{% block content %}
div class='user-info-container'
{# 'content' block from user bundle templates goes here! #}
/div
{% endblock %}

So the issue is that our base template already has a 'content' block that's 
serving a different purpose than the 'content' block in the user bundle 
templates.

Naturally we could override all the lower-level user bundle templates we're 
using, and just modify their 'content' blocks directly.  We could also 
rename the 'content' block of our base template and update our other 
templates which inherit from it.  Neither of these options would be terribly 
difficult, but I'm wondering if there's a cleaner way to do it.  I'm almost 
imagining something like:

{# Overrides FOSUserBundle::layout.html.twig #}
{% extends 'MyBundle::base.html.twig with { 'content': 'base_content' } %}
{% block base_content %}
div class='user-info-container'
{% block content %}
{% endblock %}
/div
{% endblock %}

Anyone know if something like this is feasible, or if there's a better way 
to be handling this situation?

Thanks!
Kevin

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] symfony 1.4 - renderComponent() and ajax problem

2011-06-22 Thread vviippola
Hi ppl,

I'm going crazy with this issue, probably something trivial I'm not
able to figure out.

I have a component which works fine when included on template using
include_component()

However, when I do this for ajax calls I'm getting an error.

if ($request-isXmlHttpRequest())
{
return $this-renderComponent(product_comment, showComment,
array('comment' = $product_comment, 'class' = hidden));
}

error_log: The template Success.php does not exist or is unreadable
in 

Serious debugging has taken place, but I'm just not able to figure
this out...

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Security - UserProvider with Web Service - Get the password

2011-06-22 Thread Arturo Sevilla
Hi,

loadUserByUsername() is not used to check the password. The password is 
checked once you get the user in memory by comparing the hashes (or 
plaintext if no encoder is used).

You will need to implement the web service so you could return the user by 
its username, and configure Symfony so that it checks the password with the 
correct hashing algorithm that is stored in the user object.

Think of loadUserByUsername() as if you were executing a SELECT * FROM User 
WHERE username = $username, and then you check that the hashes coincide 
through PHP.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Stof : MappingException

2011-06-22 Thread Benoît Bergstörm
Hi Christophe,

i'm moving forward :)

i'm trying to set my Area::$name property translatable.
i added gedmo annotations to my class directly (see below). i use the Sonata
AdminBundle to edit my 'Area' object.
and the default saving still use the table 'name' field and not the
'ext_translation' table.

shall i surcharge the saving method in the admin ? do you have any idea ?

cheers

Benoît

--

?php

 namespace Mr\StartBundle\Entity;

 use Doctrine\ORM\Mapping as ORM;

 use Gedmo\Mapping\Annotation as GEDMO;
 use Gedmo\Translatable\Translatable;

 /**
  * Mr\StartBundle\Entity\MrArea
  *
  * @ORM\Table(name=mr_area)
  * @ORM\Entity
  */
 class MrArea implements Translatable
 {

 /**
  * @var integer $id
  */
 private $id;

 /**
  * @var string $name
  *
  * @GEDMO\Translatable
  */
 private $name;

 /**
  * Used locale to override Translation listener`s locale
  * this is not a mapped field of entity metadata, just a simple
 property
  *
  * @GEDMO\Locale
  */
 private $locale;

 public function setTranslatableLocale($locale)
 {
 $this-locale = $locale;
 }

 ...

 }



2011/6/20 Christophe COEVOET s...@notk.org

 Le 17/06/2011 22:29, mrdev a écrit :

 Hi there,

 since i decided to use the translatable feature of the Stof
 \DoctrineExtensionsBundle i get this error

   [Doctrine\ORM\Mapping
 \MappingException]
   No identifier/primary key specified for Entity 'Stof
 \DoctrineExtensionsBundle\**Entity\LogEntry'. Every Entity must have an
 identifier/primary key.

 i tried everything i found on the web, playing with annotations and
 the LogEntry class has protected id property inherited from
 AbstractLogEntry (no private property)...

 i'm stuck.

 any help ?

 thanks

 Benoît

  This is a bug with the Doctrine EntityGenerator which has some issues
 with inheritance. The workaround is to disable the mapping of the bundle
 when you want to use the CLI command to generate your entities (disabling it
 is documented in the bundle doc) and to activate it again after running the
 command.

 --
 Christophe | Stof

 --
 If you want to report a vulnerability issue on symfony, please send it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscribe@**googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/symfony-users?hl=enhttp://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: [SF2] WebTestCase - Simulate AJAX Request

2011-06-22 Thread Arturo Sevilla
You would need to set the HTTP Header X-Requested-With to XmlHttpRequest

http://stackoverflow.com/questions/3124636/detect-ajax-calling-url

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en