[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Richtermeister
Hey Tom,

I wrote the ecommerce part of www.skinmedica.com, which uses a quite
complex promotions setup and took some iterations to get it right. I'd
be happy to help.

Our cart works similar to what Antoine said, where the shopping cart
is distinct from the final order, and mostly responsible for keeping
track of what's in it for calculating prices (shipping, tax, total,
etc. - the cart is actually composed of different independent service
classes to look up shipping,  tax via webservices). Generally we try
to keep the cart very limited in what it knows about the rest of the
system.

The way the promotions work is that they're being applied to the cart
without the cart knowing much about what is happening. A promotion is
basically handed the entire cart and it gets to decide whether it
applies. It does that by using a separate class, a promotion
criterion, which depending on its type can apply different logic to
trigger whether it applies. For example, we have promotion criteria
that trigger based on:
- a certain cart subtotal
- whether a certain product is in the cart
- whether the customer is new
- etc.
Those are all different classes, extending a BasePromotionCriterion,
that are further customizable via parameters from an admin area.

When the promotion applies, it gets to make changes to the cart. Those
changes, in turn, depend on the type of the promotion class.
We have promotions that:
- apply a cart discount
- apply a product discount
- add a free product
- make shipping free of charge
- etc.

By combining criterion classes with promotions classes, and passing a
few parameters along, you can create virtually any combination of
promotions, and when you find limitations, you can simply add more
classes. Plus, this is fairly easy to administer.

The hardest part is issues like precedence and mutual exclusivity. For
example, if a promotion applies a cart discount at a certain subtotal,
then that in turn can lower the subtotal. So, the system needs to be
smart enough not to remove the promotion again. Or, there are
szenarios where 2 free shipping promotions are applicable, but the
system should only apply one (usually the cheaper one, but that can
vary).
So, basically we apply weights to classes to figure out in which order
the promotions apply, and there is an override parameter that enables
each promotion to override others, for some manual finetuning.
Sorting that all out is a matter of a series of interesting loops with
callbacks that cost me a few sleepless nights :)

Does that help? Let me know if you have any specific questions and I'd
be happy to help more.
Daniel



On Mar 29, 5:56 pm, Tom Haskins-Vaughan t...@templestreetmedia.com
wrote:
 (sf1.4/Doctrine)

 Hi all,

 Let's say I'm developing an ecommerce solution. I have the following models:

 Order - takes a shopping cart all the way through to an actual order.

 OrderItem - link between the Order and one or more Products

 Product - a catalogue of products

 Promotion - e.g., buy one get one free, or 10% off item, buy these
 both for $10, etc

 The part I'm interested in is the promotions. I *could* do the logic
 in the Order model like so:

 $order = new Order();
 ...
 $order-applyPromotion($promotion);

 But there is likely to be quite a lot of logic, depending on what kind
 of promotion it is (adding OrderItems, discounting Orders, etc), so my
 instinct was to create a PromotionManager class so for example:

 $promoManager = new PromotionManager();
 $promoManager-appyPromotion($promotion, $order);

 Is this a better way to go, or am I causing myself needless abstraction?

 I know there's more than one way to skin a cat, but I'm trying hard to
 get to grips with the best way.

 Anyway, thanks in advance.

 Tom

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: After editing the data of a member logged, loggingin is not possible

2010-03-30 Thread Tom Ptacnik
Ok, then there are some more steps you have to do to make it work.
Just creating the module based on the database isn't enough.

Look into the PluginsfGuardUser and other classes in this plugin.
There are some methods you have to copy into your generated class
(classes), or maybe you can inherit it...




On 28 bře, 18:01, Javier Garcia tirengar...@gmail.com wrote:
 To delimit the problem, i have created a module based just on
 sfGuardUser, so no inherits:

  php symfony doctrine:generate-module --with-show frontend
 guardausuario sfGuardUser

 These are my steps:

 - Install symfony  sfDoctrineGuardUser
 - Create a module based on sfGuardUser called 'foo'.
 - Execute 'frontend_dev.php/foo/edit/id/X' and push the 'Save' button.
 - The value of 'password' changes.

 Javi

 On Mar 28, 1:53 pm, Tom Ptacnik to...@tomor.cz wrote:



  Maybe you havent in your model the method which are in
  PluginsfGuardUser ?

  From which class is your model inherited?

  In PluginsfGuardUser there is an method setPassword() overwritten - it
  handle the not changing blank password

  On 26 bře, 19:02, Javier Garcia tirengar...@gmail.com wrote:

   Even if i unset 'password' field, it happens the same..

   Javi

   On Mar 26, 5:45 pm, Javier Garcia tirengar...@gmail.com wrote:

Hi again,

i have realized that when i push the Save button in edit form, the
value of the field 'password' changes (well its encrypted version).
Why?

I tried this time with symfony 1.3 and it happens the same.

Javi

On Mar 26, 2:06 pm, Javier Garcia tirengar...@gmail.com wrote:

 Hi,

 i have installed sfDoctrineGuardUser and have created this model that
 inherits sfGuardUser model:

 Usuario:
    inheritance:
      extends: sfGuardUser
      type: simple
    columns:
      nombre_apellidos: string(60)
      sexo: boolean
      fecha_nac: date
      provincia: string(60)
      localidad: string(255)
      email_address: string(255)
      avatar: string(255)
      avatar_mensajes: string(255)

 I have also created a module called 'miembros' based on that model.

 Well, I log normally through sfGuardAuth/signin, then i go to
 miembros/edit/id/$id_of_the_member_i_used_to_log_in and push [Saved]
 button. Then i logout.

 If i try to log in again, it says: The username and/or password is
 invalid.

 If i load again the data member in the database, loggingin works 
 again.

 Any idea?

 Sf 1.2

 Javi

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Adding action, object_actions - action does not exist ?

2010-03-30 Thread Tom Ptacnik
I think that the problem is in routing because the error: Action
general/action does not exist. ... it's looking into the module
general instead of your own module.

On 26 bře, 11:04, Rs232 n.jo...@gmail.com wrote:
 hello, here I use the admin generator, I would like to add an action
 showInfos on my items so I change my generator.yml

 Code:

  object_actions:
           _edit:
              Label: Edit
           showInfos: (label: News, Action: showInfos)

 Then I added in shares \ actions.class.php the following code

 Code:

 class generalActions extends autoGeneralActions
 {
   public  function executeShowInfos (sfWebRequest $request)
   {
     $this-hardware = 
 Doctrine::getTable('hardware')-createQuery('a')-addWhere('id='.$request-getParameter(id))-fetchOne();

     $this-setTemplate('showInfos');
   }}

 I add in the template file showInfosSuccess.php to display my info
 and so when I want to run the action I have the following error
 Code:

 404 | Not Found | sfError404Exception
 Action general/action does not exist.

 thank you for your help

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Trying to translate sfDoctrineGuardPlugin

2010-03-30 Thread Tom Ptacnik
Use the /apps/APPNAME/i18n folder, use the sf_guard.es_ES.xml

and in the settings.yml:
all:
  .settings:
i18n:   true
default_culture:es_ES


On 29 bře, 15:42, Javier Garcia tirengar...@gmail.com wrote:
 On 03/29/2010 03:05 PM, Massimiliano Arione wrote:

  Just use standard messages.es.xml file in your app/APPNAME/i18n
  directory.

 Thanks Massimiliano, but it doesn't work..

 Javi

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Re: sfWidgetFormInputHidden

2010-03-30 Thread Gareth McCumskey
For one you shouldn't define your custom code withing the Base classes
as far as I know. You should instead create your own classes that
extend that base class. Maybe Doctrine is different that way as I have
not used Doctrine at all, but I don't think I am wrong.

On Tue, Mar 30, 2010 at 12:00 AM, Veríssimo jveriss...@gmail.com wrote:
 I have created a route like this:
 linharecibo_new:
  url:     /linharecibo/new/
  class:   sfDoctrineRoute
  options: { model: Recibo, type: object }
  param:   { module: linharecibo, action: new }
  requirements:
    sf_method: [get]

 And i have changed de executeNew action.
  public function executeNew(sfWebRequest $request)
  {

  $linha = new LinhaRecibo();
  $id_recibo = $this-getRoute()-getObject()-getId();

  $linha-setIdrecibo($id_recibo);

   // $this-forward404Unless($id_recibo);
    $this-form = new LinhareciboForm($linha);
    }

 I have changed to this, like Gareth McCumskey sad  but i get the same
 error. What I'm doing wrong?

  public function executeNew(sfWebRequest $request)
  {

  $linha = new LinhaRecibo();
  $id_recibo = $this-getRoute()-getObject()-getId();

  $linha-setIdrecibo($id_recibo);

   // $this-forward404Unless($this-id_recibo);
    $this-form = new LinhareciboForm();
    //$this-form = new LinhareciboForm($linha);
    $this-form-setDefault('idrecibo', $id_recibo);

  }

 this is the default code to validate the form:


 abstract class BaseLinhareciboForm extends BaseFormDoctrine
 {
  public function setup()
  {
    $this-setWidgets(array(
      'id'        = new sfWidgetFormInputHidden(),
      'idrecibo'  = new sfWidgetFormInputHidden(),
      'idproduto' = new sfWidgetFormDoctrineChoice(array('model' =
 $this-getRelatedModelName('Produto'), 'add_empty' = false)),
      'quatidade' = new sfWidgetFormInputText(),
      'total'     = new sfWidgetFormInputText(),
    ));

    $this-setValidators(array(
      'id'        = new sfValidatorDoctrineChoice(array('model' =
 $this-getModelName(), 'column' = 'id', 'required' = false)),
      'idrecibo'  = new sfValidatorDoctrineChoice(array('model' =
 $this-getModelName(), 'column' = 'idrecibo', 'required' = false)),
      'idproduto' = new sfValidatorDoctrineChoice(array('model' =
 $this-getRelatedModelName('Produto'))),
      'quatidade' = new sfValidatorInteger(),
      'total'     = new sfValidatorNumber(),
    ));

    $this-widgetSchema-setNameFormat('linharecibo[%s]');

    $this-errorSchema = new sfValidatorErrorSchema($this-
validatorSchema);

    $this-setupInheritance();

    parent::setup();
  }

  thank you for your help.

 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.




-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Re: question about cache

2010-03-30 Thread Michał Piotrowski
2010/3/30 Antoine S. antoine.spodobal...@gmail.com:
 Hi,

 First you don't really need the doc.
 The most important is : you can have a cache.yml file at different
 level and refine for any module, action, partial.

 Second, the contextual option is very important. If it's true, it
 will parse the parameters to store the cache file.
 Ex: if you cache a product page with contextual true, for any id in
 the url (so each product) will have its own cache.

This will not work in my case - for the same url I may have a
different content in _list partial for different user.


 You can sometimes force to use the contextual.
 Ex. I have a partial : _header_layout.php with a basic menu and a
 text : Hello Username.
 Because I can't store this partial for all user, I have to make it
 contextual to the user.
 include_partial('header_layout', array($user=$sf_user-getId());

Same situation here - but I don't cache layout.


 For your application, you probably don't want a cache for the editor
 (you will spend time to delete the cache),
 but a cache for the visitor.

Good poit. But I need to delete cache after each edition - because
something may become visible or not visible for visitors.

 I extend sfViewCacheManager, overrride ignore() to ignore the cache on
 special credential (ex. editor)


 I can't help you more I think. It depends then of your application and
 choice.
 Then, you have sometimes to restructure (/isolate) to be able to use a
 cache.

Yes, this is what I need to do in my case.

Thanks for your answer

Regards,
Michal



 On Mar 30, 2:41 am, Michał Piotrowski mkkp...@gmail.com wrote:
 2010/3/29 Massimiliano Arione garak...@gmail.com:

  The solution is to not cache the entire action. Just cache parts of it
  (e.g. partials)

 It is not possible in my case - for example I've got

 indexSuccess.php that include
  _list.php that include
   _show.php

 I need to change some design concepts and use normal cache.

 Regards,
 Michal



  cheers
  Massimiliano

  On 28 Mar, 22:42, Micha³ Piotrowski mkkp...@gmail.com wrote:
  2010/3/28 Antoine S. antoine.spodobal...@gmail.com:

   Hi,

   You can refine the cache (cache.yml) at any level : application,
   module, action, component, partial

   see the doc

  Can you point me to the doc that you are referring?

  I have checked in symfony 1.4 refernece The cache.yml Configuration 
  File,http://www.symfony-project.org/book/1_2/12-Cachinghttp://www.symfony-...
  and few others returned by google.

  It always works in this 
  wayhttp://www.symfony-project.org/images/jobeet/1_4/21/flow_cache_page.png

  Maybe I'm blind, but I don't see any way to execute an action here...

  Regards,
  Michal

  --
  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

  To unsubscribe from this group, send email to 
  symfony-users+unsubscribegooglegroups.com or reply to this email with the 
  words REMOVE ME as the subject.

 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Custom Under Maintenance page

2010-03-30 Thread wueb
Do you redirect the default in routing.yml to the module you created?


On 29 Mar, 22:51, ruigoncalves skcra...@gmail.com wrote:
 Hi there!

 I'm trying to add a custom page to my web application for the times
 I'm performing maintenance. I'm trying to test the referred page on my
 development environment but always appear the symfony page. I had
 already created a module with a proper action and template and also
 configured those on the settings.yml file.

 Can anyone give me some help?

 Thanks in advance,
 Best 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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Cross app / system wide i18n files

2010-03-30 Thread Benoit
Hello,

I had a translated project compouned by 2 apps : backend and frontend.
I use i18n even for one language projects, it avoid me redefining
sames labels in all backend generator.yml files and it allows further
evolution to internationalization.
Anyway, my problem is in these apps, certains terms (forms labels
mostly)  needs to be translated for both back and front office.

Is there any way to keep translation in a common XLIFF file ?  I
looked out documentation and tried putting files at project root, in
config dir, etc. without success.

If that wasn't an option, I would try putting translations in a
plugin.

Regards,
Benoit

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Re: question about cache

2010-03-30 Thread Alexandru-Emil Lupu
?php include_partial('user/my_partial', array(
  'user' = $user,
  'sf_cache_key' = $user-getId()
) ?


http://www.symfony-project.org/book/1_2/12-Caching

Alecs

2010/3/30 Michał Piotrowski mkkp...@gmail.com:
 2010/3/30 Antoine S. antoine.spodobal...@gmail.com:
 Hi,

 First you don't really need the doc.
 The most important is : you can have a cache.yml file at different
 level and refine for any module, action, partial.

 Second, the contextual option is very important. If it's true, it
 will parse the parameters to store the cache file.
 Ex: if you cache a product page with contextual true, for any id in
 the url (so each product) will have its own cache.

 This will not work in my case - for the same url I may have a
 different content in _list partial for different user.


 You can sometimes force to use the contextual.
 Ex. I have a partial : _header_layout.php with a basic menu and a
 text : Hello Username.
 Because I can't store this partial for all user, I have to make it
 contextual to the user.
 include_partial('header_layout', array($user=$sf_user-getId());

 Same situation here - but I don't cache layout.


 For your application, you probably don't want a cache for the editor
 (you will spend time to delete the cache),
 but a cache for the visitor.

 Good poit. But I need to delete cache after each edition - because
 something may become visible or not visible for visitors.

 I extend sfViewCacheManager, overrride ignore() to ignore the cache on
 special credential (ex. editor)


 I can't help you more I think. It depends then of your application and
 choice.
 Then, you have sometimes to restructure (/isolate) to be able to use a
 cache.

 Yes, this is what I need to do in my case.

 Thanks for your answer

 Regards,
 Michal



 On Mar 30, 2:41 am, Michał Piotrowski mkkp...@gmail.com wrote:
 2010/3/29 Massimiliano Arione garak...@gmail.com:

  The solution is to not cache the entire action. Just cache parts of it
  (e.g. partials)

 It is not possible in my case - for example I've got

 indexSuccess.php that include
  _list.php that include
   _show.php

 I need to change some design concepts and use normal cache.

 Regards,
 Michal



  cheers
  Massimiliano

  On 28 Mar, 22:42, Micha³ Piotrowski mkkp...@gmail.com wrote:
  2010/3/28 Antoine S. antoine.spodobal...@gmail.com:

   Hi,

   You can refine the cache (cache.yml) at any level : application,
   module, action, component, partial

   see the doc

  Can you point me to the doc that you are referring?

  I have checked in symfony 1.4 refernece The cache.yml Configuration 
  File,http://www.symfony-project.org/book/1_2/12-Cachinghttp://www.symfony-...
  and few others returned by google.

  It always works in this 
  wayhttp://www.symfony-project.org/images/jobeet/1_4/21/flow_cache_page.png

  Maybe I'm blind, but I don't see any way to execute an action here...

  Regards,
  Michal

  --
  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

  To unsubscribe from this group, send email to 
  symfony-users+unsubscribegooglegroups.com or reply to this email with the 
  words REMOVE ME as the subject.

 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.


 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.




-- 
Have a nice day!

Alecs
Certified ScrumMaster

There are no cannibals alive! I have ate the last one yesterday ...
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I 

Re: [symfony-users] Re: Custom Under Maintenance page

2010-03-30 Thread Alexandru-Emil Lupu
http://www.symfony-check.org/



On Tue, Mar 30, 2010 at 11:42 AM, wueb webmaster@gmail.com wrote:
 Do you redirect the default in routing.yml to the module you created?


 On 29 Mar, 22:51, ruigoncalves skcra...@gmail.com wrote:
 Hi there!

 I'm trying to add a custom page to my web application for the times
 I'm performing maintenance. I'm trying to test the referred page on my
 development environment but always appear the symfony page. I had
 already created a module with a proper action and template and also
 configured those on the settings.yml file.

 Can anyone give me some help?

 Thanks in advance,
 Best 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.




-- 
Have a nice day!

Alecs
Certified ScrumMaster

There are no cannibals alive! I have ate the last one yesterday ...
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0722 621 280

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Custom Under Maintenance page

2010-03-30 Thread Michał Piotrowski
2010/3/29 ruigoncalves skcra...@gmail.com:
 Hi there!

 I'm trying to add a custom page to my web application for the times
 I'm performing maintenance. I'm trying to test the referred page on my
 development environment but always appear the symfony page. I had
 already created a module with a proper action and template and also
 configured those on the settings.yml file.

Add
check_lock: true
to frontend/config/settings.yml

Create frontend/config/unavailable.php with custom text

Now you can login on server and perform

symfony project:disable frontend prod (to take service down)
symfony project:enable frontend prod (to take it back)

Redirecting default in routing.yml isn't a good solution, because
there are other routes.

Regards,
Michal


 Can anyone give me some help?

 Thanks in advance,
 Best 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Custom Under Maintenance page

2010-03-30 Thread Michał Piotrowski
W dniu 30 marca 2010 11:00 użytkownik Michał Piotrowski
mkkp...@gmail.com napisał:
 2010/3/29 ruigoncalves skcra...@gmail.com:
 Hi there!

 I'm trying to add a custom page to my web application for the times
 I'm performing maintenance. I'm trying to test the referred page on my
 development environment but always appear the symfony page. I had
 already created a module with a proper action and template and also
 configured those on the settings.yml file.

 Add
 check_lock:             true
 to frontend/config/settings.yml

 Create frontend/config/unavailable.php with custom text

 Now you can login on server and perform

 symfony project:disable frontend prod (to take service down)
 symfony project:enable frontend prod (to take it back)


BTW. You need to add
/data/frontend_prod.lck
to your rsync_exclude if you want to use this solution and project:deploy.

Otherwise you will remove service lock during upgrade

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] demande_aide

2010-03-30 Thread safa boubekri
  bonjour svp  j'ai installer le plugin sfGuardDoctrine ça marche mais lors
de création du module   sfGuardAuth  il  affiche Empty module and/or action
after parsing the URL /sfGuardAuth/ (/).

vu que  j'ai suivi  les etapes du
http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin  vraiment je
suis bloqué


merci d'avance

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] problème/sfGuardDoctrine

2010-03-30 Thread safa boubekri
 bonjour svp  j'ai installer le plugin sfGuardDoctrine ça marche mais lors
de création du module   sfGuardAuth  il  afficheEmpty module and/or action
after parsing the URL /sfGuardAuth/ (/).

vu que  j'ai suivi  les etapes du
http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin  vraiment je
suis bloqué


merci d'avance
--

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] demande_aide

2010-03-30 Thread Alexandru-Emil Lupu
english please

On Tue, Mar 30, 2010 at 12:47 PM, safa boubekri boubekri.s...@gmail.com wrote:



   bonjour svp  j'ai installer le plugin sfGuardDoctrine ça marche mais lors
 de création du module   sfGuardAuth  il  affiche

 Empty module and/or action after parsing the URL /sfGuardAuth/ (/).

 vu que  j'ai suivi  les etapes
 du http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin  vraiment je
 suis bloqué

 merci d'avance

 --
 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

 To unsubscribe from this group, send email to
 symfony-users+unsubscribegooglegroups.com or reply to this email with the
 words REMOVE ME as the subject.




-- 
Have a nice day!

Alecs
Certified ScrumMaster

There are no cannibals alive! I have ate the last one yesterday ...
I am on web:  http://www.alecslupu.ro/
I am on twitter: http://twitter.com/alecslupu
I am on linkedIn: http://www.linkedin.com/in/alecslupu
Tel: (+4)0722 621 280

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Frontend // pager or filter display issue

2010-03-30 Thread ziclo
I simply copied the actions.php file found into the cache folder (for
backend) for my frontend module. Then, always from the cache/backend
folder i reproduced the same code used into the templates, copied some
classes, etc. And it works almost well.

Currently i have the same error  csrf token: Required, i think it is
because i use the same classes (frontend and backend) or because i use
the same browser on the same machine (php session).

But my problem is that after filtering the list of objects  (results)
is displayed only if the record number (objects returned) is
 max_per_page parameter.
On the backend this problem doesn't occur.

Ziclo



On 29 mar, 22:14, trankh juliend1...@gmail.com wrote:
 How do you use generator for frontend filter.

 Because i tried to do that in an other way but i have a bug.

 http://groups.google.com/group/symfony-users/browse_thread/thread/6f6...

 Thank you

 On 29 mar, 19:06,ziclolauren...@gmail.com wrote:

  Any idea ?
  Thank you for your help !

  On 27 mar, 22:06,ziclolauren...@gmail.com wrote:

   Hello,

   I use the admin generator actions and others methods for my frontend
   (i just copied actions and classes). My problem is that when i use the
   filter in order to get objects for a particular category, objects are
   displayed only if the result is  20.
   I modified the generator.yml file in order to have a list of 10
   objects max per page. Now i can see results  10 objects.

   Conclusion : The pager or filter (i don't know exactly) display the
   results according to the max_per_page parameter. But if result is 
   parameter no object is displayed.

   An idea ? Need more explanations ?

   Thank you

  Ziclo

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Re: OO conceptual advice

2010-03-30 Thread Tom Haskins-Vaughan
Thanks, guys! That's a great help. I will most probably take you up on
your offer of help! :)  In the meantime, I have a couple of follow on
questions:

1. What do you see the benefits of having a separate cart and order objects?

2. The Promotion classes were the logic takes place, are they also
model classes or are they separate classes?

Thanks again.

Tom

On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister nex...@gmail.com wrote:
 Hey Tom,

 I wrote the ecommerce part of www.skinmedica.com, which uses a quite
 complex promotions setup and took some iterations to get it right. I'd
 be happy to help.

 Our cart works similar to what Antoine said, where the shopping cart
 is distinct from the final order, and mostly responsible for keeping
 track of what's in it for calculating prices (shipping, tax, total,
 etc. - the cart is actually composed of different independent service
 classes to look up shipping,  tax via webservices). Generally we try
 to keep the cart very limited in what it knows about the rest of the
 system.

 The way the promotions work is that they're being applied to the cart
 without the cart knowing much about what is happening. A promotion is
 basically handed the entire cart and it gets to decide whether it
 applies. It does that by using a separate class, a promotion
 criterion, which depending on its type can apply different logic to
 trigger whether it applies. For example, we have promotion criteria
 that trigger based on:
 - a certain cart subtotal
 - whether a certain product is in the cart
 - whether the customer is new
 - etc.
 Those are all different classes, extending a BasePromotionCriterion,
 that are further customizable via parameters from an admin area.

 When the promotion applies, it gets to make changes to the cart. Those
 changes, in turn, depend on the type of the promotion class.
 We have promotions that:
 - apply a cart discount
 - apply a product discount
 - add a free product
 - make shipping free of charge
 - etc.

 By combining criterion classes with promotions classes, and passing a
 few parameters along, you can create virtually any combination of
 promotions, and when you find limitations, you can simply add more
 classes. Plus, this is fairly easy to administer.

 The hardest part is issues like precedence and mutual exclusivity. For
 example, if a promotion applies a cart discount at a certain subtotal,
 then that in turn can lower the subtotal. So, the system needs to be
 smart enough not to remove the promotion again. Or, there are
 szenarios where 2 free shipping promotions are applicable, but the
 system should only apply one (usually the cheaper one, but that can
 vary).
 So, basically we apply weights to classes to figure out in which order
 the promotions apply, and there is an override parameter that enables
 each promotion to override others, for some manual finetuning.
 Sorting that all out is a matter of a series of interesting loops with
 callbacks that cost me a few sleepless nights :)

 Does that help? Let me know if you have any specific questions and I'd
 be happy to help more.
 Daniel



 On Mar 29, 5:56 pm, Tom Haskins-Vaughan t...@templestreetmedia.com
 wrote:
 (sf1.4/Doctrine)

 Hi all,

 Let's say I'm developing an ecommerce solution. I have the following models:

 Order - takes a shopping cart all the way through to an actual order.

 OrderItem - link between the Order and one or more Products

 Product - a catalogue of products

 Promotion - e.g., buy one get one free, or 10% off item, buy these
 both for $10, etc

 The part I'm interested in is the promotions. I *could* do the logic
 in the Order model like so:

 $order = new Order();
 ...
 $order-applyPromotion($promotion);

 But there is likely to be quite a lot of logic, depending on what kind
 of promotion it is (adding OrderItems, discounting Orders, etc), so my
 instinct was to create a PromotionManager class so for example:

 $promoManager = new PromotionManager();
 $promoManager-appyPromotion($promotion, $order);

 Is this a better way to go, or am I causing myself needless abstraction?

 I know there's more than one way to skin a cat, but I'm trying hard to
 get to grips with the best way.

 Anyway, thanks in advance.

 Tom

 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.


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

You received this message 

[symfony-users] Why i can not retrieve a constant from app.yml ?

2010-03-30 Thread Javier Garcia

Hi,

this is my frontend/config/app.yml

all:

  sf_doctrineguard_plugin:
app_sf_guard_plugin_signin_form:sfGuardFormSigninByEmail


and i have this code in 
plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php 




class BasesfGuardAuthActions extends sfActions
{
function executeSignin($request)
  {
   //...

$class = sfConfig::get('app_sf_guard_plugin_signin_form', 
'sfGuardFormSignin');


echo $class;
  }
}


When i execute the signin action, it always shows 'sfGuardFormSignin' 
instead of 'sfGuardFormSigninByEmail'.


Why?

Javi

--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


[symfony-users] Re: Invoice Model

2010-03-30 Thread Massimiliano Arione
You don't need to check.
The getObject() method returns null if no object associated, and this
is fine with form instance.
Just avoid to echo object's id in the form's configure why are you
doing this???

cheers
Massimiliano

On 30 Mar, 01:07, Veríssimo jveriss...@gmail.com wrote:
 I have implemented this, but i only have the Object after a previous
 have saved it.

 Do i have to do something like check ($this-getObject()) as a object?

   public function configure()
   {
    $subForm = new sfForm();
   for ($i = 0; $i  2; $i++)
   {
     $linharecibo = new Linharecibo();
     $linharecibo-Recibo = $this-getObject(); #This line does not
 have a object the first time
     echo 'Raios'.$linharecibo-Recibo-getId();
     $form = new LinhareciboForm($linharecibo);

     $subForm-embedForm($i, $form);
   }
   $this-embedForm('Linhas', $subForm);

   }

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Why i can not retrieve a constant from app.yml ?

2010-03-30 Thread Benoit Montuelle
Hi,

Configuration files use an arborescent model,

Say you have a app.yml like this
all:
   sf_doctrineguard_plugin:
form:sfGuardFormSigninByEmail

You should be able to retrieve the value using
$class = sfConfig::get('app_sf_doctrineguard_plugin_form');

All you have to do is replacing subsequent levels with underscores in the
key name of config value

In your case, it returns 'sfGuardFormSignin' because you passed it to
sfConfig::get as default value (second parameter), and your config is not
existing

Benoit


2010/3/30 Javier Garcia tirengar...@gmail.com

 Hi,

 this is my frontend/config/app.yml

 all:

  sf_doctrineguard_plugin:
app_sf_guard_plugin_signin_form:sfGuardFormSigninByEmail


 and i have this code in
 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php



 class BasesfGuardAuthActions extends sfActions
 {
 function executeSignin($request)
  {
   //...

$class = sfConfig::get('app_sf_guard_plugin_signin_form',
 'sfGuardFormSignin');

echo $class;
  }
 }


 When i execute the signin action, it always shows 'sfGuardFormSignin'
 instead of 'sfGuardFormSigninByEmail'.

 Why?

 Javi

 --
 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 To unsubscribe from this group, send email to symfony-users+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Why i can not retrieve a constant from app.yml ?

2010-03-30 Thread Jose Antonio Pio Gil
Try this:

all:
 sf_doctrineguard_plugin:
   app_sf_guard_plugin_signin_form: sfGuardFormSigninByEmail


$class =
sfConfig::get('app_sf_doctrineguard_plugin_app_sf_guard_plugin_signin_form',
'sfGuardFormSignin');


or change your app.yml to:

all:
  sf_guard_plugin:
signin_form: sfGuardFormSigninByEmail



 JAP



2010/3/30 Benoit Montuelle benoit.montue...@gmail.com

 all:

  sf_doctrineguard_plugin:
app_sf_guard_plugin_signin_form:sfGuardFormSigninByEmail


 and i have this code in
 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php



 class BasesfGuardAuthActions extends sfActions
 {
 function executeSignin($request)
  {
   //...

$class = sfConfig::get('app_sf_guard_plugin_signin_form',
 'sfGuardFormSignin');



-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Why i can not retrieve a constant from app.yml ?

2010-03-30 Thread Javier Garcia

Works, thanks both!

On 03/30/2010 04:02 PM, Jose Antonio Pio Gil wrote:

Try this:

all:
 sf_doctrineguard_plugin:
   app_sf_guard_plugin_signin_form: sfGuardFormSigninByEmail


$class = 
sfConfig::get('app_sf_doctrineguard_plugin_app_sf_guard_plugin_signin_form', 
'sfGuardFormSignin');



or change your app.yml to:

all:
  sf_guard_plugin:
signin_form: sfGuardFormSigninByEmail



 JAP



2010/3/30 Benoit Montuelle benoit.montue...@gmail.com 
mailto:benoit.montue...@gmail.com


all:

 sf_doctrineguard_plugin:
   app_sf_guard_plugin_signin_form:sfGuardFormSigninByEmail


and i have this code in

plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php



class BasesfGuardAuthActions extends sfActions
{
function executeSignin($request)
 {
  //...

   $class = sfConfig::get('app_sf_guard_plugin_signin_form',
'sfGuardFormSignin');


--
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with 
the words REMOVE ME as the subject.


--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


[symfony-users] return redirect() breaks the code ?

2010-03-30 Thread NOOVEO - Christophe Brun
I want to catch some exceptions in my actions and to display nice and
informative messages for my users. 
 
class utilisateursActions extends autoUtilisateursActions {
public function executeDelete(sfWebRequest $request) {
   try {
  // do stuff...
  sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
.__LINE__); // line 50
  return $this-redirect('@avalidroute');
   }
   catch(Exception $x) {
  sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
.__LINE__); // line 54
  $this-getUser()-setFlash('error', 'KO');
   }
}
}
 
Unfortunately, the flash and the log tells me that the code goes through
50, redirects to the required route, AND goes on to line 54 + flashes
the error. 
 
I already knew that $action-redirect() has the side effect (very
unfortunate as all side effects are IMHO) to break the standard flow of
code, that's why you must return $action-redirect() instead. 
But what if return $obj-redirect() also breaks the flow ? 
Or am I missing some elephant hidden in my kitchen ? 

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] return redirect() breaks the code ?

2010-03-30 Thread Gábor Fási
Calling redirect() throws an sfStopException [1] to stop the
execution, as it is not needed anymore after you have redirected.

http://trac.symfony-project.org/browser/branches/1.4/lib/action/sfAction.class.php#L204

On Tue, Mar 30, 2010 at 17:14, NOOVEO - Christophe Brun
c.b...@nooveo.fr wrote:
 I want to catch some exceptions in my actions and to display nice and
 informative messages for my users.

 class utilisateursActions extends autoUtilisateursActions {
     public function executeDelete(sfWebRequest $request) {
    try {
   // do stuff...
   sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
 .__LINE__); // line 50
   return $this-redirect('@avalidroute');
    }
    catch(Exception $x) {
   sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
 .__LINE__); // line 54
   $this-getUser()-setFlash('error', 'KO');
    }
     }
 }

 Unfortunately, the flash and the log tells me that the code goes through 50,
 redirects to the required route, AND goes on to line 54 + flashes the error.

 I already knew that $action-redirect() has the side effect (very
 unfortunate as all side effects are IMHO) to break the standard flow of
 code, that's why you must return $action-redirect() instead.
 But what if return $obj-redirect() also breaks the flow ?
 Or am I missing some elephant hidden in my kitchen ?

 --
 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

 To unsubscribe from this group, send email to
 symfony-users+unsubscribegooglegroups.com or reply to this email with the
 words REMOVE ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] return redirect() breaks the code ?

2010-03-30 Thread Rafael Barbosa
The very last thing the redirect() method does is throw a sfStopException
that's why it goes all the way through try AND catch.

On Tue, Mar 30, 2010 at 12:14 PM, NOOVEO - Christophe Brun c.b...@nooveo.fr
 wrote:

  I want to catch some exceptions in my actions and to display nice and
 informative messages for my users.

 class utilisateursActions extends autoUtilisateursActions {
 public function executeDelete(sfWebRequest $request) {
try {
   // do stuff...
   sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
 .__LINE__); // line 50
   return $this-redirect('@avalidroute' %...@avalidroute%27);
}
catch(Exception $x) {
   sfContext::getInstance()-getLogger()-err(__METHOD__. ligne
 .__LINE__); // line 54
   $this-getUser()-setFlash('error', 'KO');
}
 }
 }

 Unfortunately, the flash and the log tells me that the code goes through
 50, redirects to the required route, AND goes on to line 54 + flashes the
 error.

 I already knew that $action-redirect() has the side effect (very
 unfortunate as all side effects are IMHO) to break the standard flow of
 code, that's why you must return $action-redirect() instead.
 But what if return $obj-redirect() also breaks the flow ?
 Or am I missing some elephant hidden in my kitchen ?

 --
 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 To unsubscribe from this group, send email to symfony-users+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] What about the Remember me widget? What it serves for? Is useful?

2010-03-30 Thread Javier Garcia

Hi,

the signin form of sfDoctrineGuardPlugin shows the widget Remember me.

I suppose it serves for the web browser 'remember' the password, but now 
i think it is not very used so i should remove it..


Am i right?

Javi

--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


[symfony-users] Swift Mailer Configuration

2010-03-30 Thread Jonathan Franks
I'm a bit confused. I altered my factories.yml to look like this...

all:
  mailer:
param:
  transport:
param:
  host:   smtp.gmail.com
  port:   465
  encryption: ssl
  username:   username
  password:   password

But, when I try to send an email on my local machine, running os X, little 
snitch reports that the smtp process is trying to connect to...

aspmx.l.google.com on port 25

Am I doing something wrong?

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] What about the Remember me widget? What it serves for? Is useful?

2010-03-30 Thread Gábor Fási
It is not the browser's remember password feature.
If checked, the plugin will set a cookie for a longer period, that
kinda acts like a long-term sessionid cookie. It means the user will
not need to log in, even after the browser is closed and the session
cookie is deleted.

On Tue, Mar 30, 2010 at 17:37, Javier Garcia tirengar...@gmail.com wrote:
 Hi,

 the signin form of sfDoctrineGuardPlugin shows the widget Remember me.

 I suppose it serves for the web browser 'remember' the password, but now i
 think it is not very used so i should remove it..

 Am i right?

 Javi

 --
 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

 To unsubscribe from this group, send email to
 symfony-users+unsubscribegooglegroups.com or reply to this email with the
 words REMOVE ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] What about the Remember me widget? What it serves for? Is useful?

2010-03-30 Thread Daniel Lohse
No, it sets a cookie with a configurable lifetime (standard is 14  
days) and automatically logs the user in to your app (only if he  
didn't log out). It's actually a pretty good example for a symfony  
filter (not filter form, mind you :)).


And no, the password is not saved anywhere in this cookie, it's a  
random hash.


Cheers, Daniel

Sent from my iPhone

On Mar 30, 2010, at 5:37 PM, Javier Garcia tirengar...@gmail.com  
wrote:



Hi,

the signin form of sfDoctrineGuardPlugin shows the widget Remember  
me.


I suppose it serves for the web browser 'remember' the password, but  
now i think it is not very used so i should remove it..


Am i right?

Javi

--
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

To unsubscribe from this group, send email to symfony-users 
+unsubscribegooglegroups.com or reply to this email with the words  
REMOVE ME as the subject.


--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


Re: [symfony-users] What about the Remember me widget? What it serves for? Is useful?

2010-03-30 Thread Daniel Lohse

Ah, you beat me to it! :)

Sent from my iPhone

On Mar 30, 2010, at 5:42 PM, Gábor Fási maerl...@gmail.com wrote:


It is not the browser's remember password feature.
If checked, the plugin will set a cookie for a longer period, that
kinda acts like a long-term sessionid cookie. It means the user will
not need to log in, even after the browser is closed and the session
cookie is deleted.

On Tue, Mar 30, 2010 at 17:37, Javier Garcia tirengar...@gmail.com  
wrote:

Hi,

the signin form of sfDoctrineGuardPlugin shows the widget Remember  
me.


I suppose it serves for the web browser 'remember' the password,  
but now i

think it is not very used so i should remove it..

Am i right?

Javi

--
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

To unsubscribe from this group, send email to
symfony-users+unsubscribegooglegroups.com or reply to this email  
with the

words REMOVE ME as the subject.



--
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

To unsubscribe from this group, send email to symfony-users 
+unsubscribegooglegroups.com or reply to this email with the words  
REMOVE ME as the subject.


--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


Re: [symfony-users] how to call stored procedure

2010-03-30 Thread Felipe Gutierrez
I have the same questions about postgres and symfony (or querying a view in
postgres 8.2.4 using symfony 1.4.1) , If I see something useful I let you
now.  rey_b...@yahoo.com


2010/3/26 birdmilk birdm...@ukr.net

 Hello,
 i'd like to ask: Does anybody knows how to call stored procedures via
 doctrine?
 I've been looking all over the internet and no usefull information or
 tip was found.

 symfony: 1.4.3
 doctrine: 1.2
 DB: PostgreSQL 8.2.4

 Thanks a lot.

 --
 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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 To unsubscribe from this group, send email to symfony-users+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Unable to retrieve data from an additional database table through a LEFT JOIN

2010-03-30 Thread El Duderino
I have been expanding on the Jobeet tutorial by adding a
JobApplication table that includes the JobeetJob id as job_id each
time after each successful application.  All seems to be going well in
the backend app in the application module that by default lists all
the data for each row but I get stuck when I try to join the two
tables and display the job name or location in addition to the data
from JobApplication.

The application module action.class.php file has this added to the
executeIndex function:

$this-jobs = Doctrine::getTable('JobApplication')
  -createQuery('a')
  -leftJoin('a.JobeetJob j')
  -execute();

If you click on the SQL queries link in the dev environment the SELECT
query has been generated successfully:

SELECT j.id AS j__id, j.firstname AS j__firstname, j.surname AS
j__surname, j.email AS j__email, j.salary AS j__salary,
j.salary_currency AS j__salary_currency, j.contract_type AS
j__contract_type, j.relocate AS j__relocate, j.cv_file AS j__cv_file,
j.job_id AS j__job_id, j.created_at AS j__created_at, j.updated_at AS
j__updated_at, j2.id AS j2__id, j2.category_id AS j2__category_id,
j2.location_id AS j2__location_id, j2.company_id AS j2__company_id,
j2.ref AS j2__ref, j2.type AS j2__type, j2.url AS j2__url, j2.position
AS j2__position, j2.location AS j2__location, j2.description AS
j2__description, j2.how_to_apply AS j2__how_to_apply, j2.token AS
j2__token, j2.is_public AS j2__is_public, j2.is_activated AS
j2__is_activated, j2.email AS j2__email, j2.expires_at AS
j2__expires_at, j2.created_at AS j2__created_at, j2.updated_at AS
j2__updated_at FROM job_application j LEFT JOIN jobeet_job j2 ON
j.job_id = j2.id

But, right after this query comes the following query and when I try
to add 'position', 'location' etc to the fields on display I get the
error message 'Unknown record property / related component position
on JobApplication'.

SELECT j.id AS j__id, j.firstname AS j__firstname, j.surname AS
j__surname, j.email AS j__email, j.salary AS j__salary,
j.salary_currency AS j__salary_currency, j.contract_type AS
j__contract_type, j.relocate AS j__relocate, j.cv_file AS j__cv_file,
j.job_id AS j__job_id, j.created_at AS j__created_at, j.updated_at AS
j__updated_at FROM job_application j ORDER BY j.created_at desc LIMIT
20

The JobApplication table 'job_id' field is linked to the JobeetJob
'id' field but I can't find out how to pull the data from the
JobeetJob table:

  relations:
JobeetJob: { onDelete: CASCADE, local: job_id, foreign: id,
foreignAlias: JobeetApplications }

Thanks for any insight/assistance on where I am going wrong!

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] $UpperCamelProperty generated in jobeet action class. is this better?

2010-03-30 Thread sanemat
hi.
i have question about name rule.

i try to learn symfony, but i confuse below.
action class, executeIndex method,

'$this-jobeet_jobs' at jobeet sample code (underscore_style)
'$this-JobeetJobs' at generated code (UpperCamelCase)

symfony1.3 propel
UpperCamelCase parameter is better symfony way?
when give params from controller to view

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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] issues in uninstall of sfGuardPlugin

2010-03-30 Thread gopi
Hi..

I install symfony with the default doctrine ORM enabled (instead of
propel)

I installed sfGuardPlugin using ./symfony plugin:install
sfGuardPlugin
php symfony doctrine:build --all --no-confirmation

This gave an error Fatal error: Class 'sfPropelBaseTask' not found
in .XXX plugins/sfGuardPlugin/lib/task/
sfGuardAddPermissionTask.class.php

Realizing that I should install the doctrine version of the plugin, I
tried to uinstall using  ./symfony plugin:uninstall sfGuardPlugin.
This too failed with the same Fatal error.   From then on none of the
symfony commands are working and giving the same error.

Any pointers on how to remove sfGuardPlugin and install the doctrine
version ?

thanks in advance
gopi

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] issues in uninstall of sfGuardPlugin

2010-03-30 Thread Michał Piotrowski
2010/3/30 gopi mgo...@gmail.com:
 Hi..

 I install symfony with the default doctrine ORM enabled (instead of
 propel)

 I installed sfGuardPlugin using ./symfony plugin:install
 sfGuardPlugin
 php symfony doctrine:build --all --no-confirmation

 This gave an error Fatal error: Class 'sfPropelBaseTask' not found
 in .XXX plugins/sfGuardPlugin/lib/task/
 sfGuardAddPermissionTask.class.php

 Realizing that I should install the doctrine version of the plugin, I
 tried to uinstall using  ./symfony plugin:uninstall sfGuardPlugin.
 This too failed with the same Fatal error.   From then on none of the
 symfony commands are working and giving the same error.

 Any pointers on how to remove sfGuardPlugin and install the doctrine
 version ?

This won't be helpful now, but maybe in the future - use git or svn
and always do backups!

Regards,
Michal


 thanks in advance
 gopi

 --
 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

 To unsubscribe from this group, send email to 
 symfony-users+unsubscribegooglegroups.com or reply to this email with the 
 words REMOVE ME as the subject.


-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] propel relation m:n

2010-03-30 Thread Julian Reyes

Hi

i have a problem with this type or relations.

in the jobeet tutorial explain the ORM make it relations many to many 
automaticly buts don't works. only saved student and guardian  but no 
student_guardian


example schema:
student: ~
guardian: ~
studiant_guardian: ~

ok. i need put an embebed guardian form into the student and when i 
click on save the orm save it for me the three tables student, guardian 
and studentguardian.


can help me someone with this problem.

thanks in advance for helping.

Julian Reyes



--
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

To unsubscribe from this group, send email to symfony-users+unsubscribegooglegroups.com 
or reply to this email with the words REMOVE ME as the subject.


[symfony-users] Re: issues in uninstall of sfGuardPlugin

2010-03-30 Thread gopi
Following steps solved the issue

+ delete the task folder from the plugin  [this made sure that the
file using sfPropelBaseTask is not in the system]
+ then try ./symfony plugin:uninstall sfGuardPlugin

thx
gopi
We just chose symfony( after evaluating django, cake, zend and RoR)
and getting started.  experience has been pretty good till now

On Mar 30, 9:07 pm, Michał Piotrowski mkkp...@gmail.com wrote:
 2010/3/30 gopi mgo...@gmail.com:



  Hi..

  I install symfony with the default doctrine ORM enabled (instead of
  propel)

  I installed sfGuardPlugin using ./symfony plugin:install
  sfGuardPlugin
  php symfony doctrine:build --all --no-confirmation

  This gave an error Fatal error: Class 'sfPropelBaseTask' not found
  in .XXX plugins/sfGuardPlugin/lib/task/
  sfGuardAddPermissionTask.class.php

  Realizing that I should install the doctrine version of the plugin, I
  tried to uinstall using  ./symfony plugin:uninstall sfGuardPlugin.
  This too failed with the same Fatal error.   From then on none of the
  symfony commands are working and giving the same error.

  Any pointers on how to remove sfGuardPlugin and install the doctrine
  version ?

 This won't be helpful now, but maybe in the future - use git or svn
 and always do backups!

 Regards,
 Michal



  thanks in advance
  gopi

  --
  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

  To unsubscribe from this group, send email to 
  symfony-users+unsubscribegooglegroups.com or reply to this email with the 
  words REMOVE ME as the subject.

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: issues in uninstall of sfGuardPlugin

2010-03-30 Thread gopi
Following steps solved the issue

+ delete the task folder from the plugin  [this made sure that the
file using sfPropelBaseTask is not in the system]
+ then try ./symfony plugin:uninstall sfGuardPlugin

thx
gopi
We just chose symfony( after evaluating django, cake, zend and RoR)
and getting started.  experience has been pretty good till now

On Mar 30, 9:07 pm, Michał Piotrowski mkkp...@gmail.com wrote:
 2010/3/30 gopi mgo...@gmail.com:



  Hi..

  I install symfony with the default doctrine ORM enabled (instead of
  propel)

  I installed sfGuardPlugin using ./symfony plugin:install
  sfGuardPlugin
  php symfony doctrine:build --all --no-confirmation

  This gave an error Fatal error: Class 'sfPropelBaseTask' not found
  in .XXX plugins/sfGuardPlugin/lib/task/
  sfGuardAddPermissionTask.class.php

  Realizing that I should install the doctrine version of the plugin, I
  tried to uinstall using  ./symfony plugin:uninstall sfGuardPlugin.
  This too failed with the same Fatal error.   From then on none of the
  symfony commands are working and giving the same error.

  Any pointers on how to remove sfGuardPlugin and install the doctrine
  version ?

 This won't be helpful now, but maybe in the future - use git or svn
 and always do backups!

 Regards,
 Michal



  thanks in advance
  gopi

  --
  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

  To unsubscribe from this group, send email to 
  symfony-users+unsubscribegooglegroups.com or reply to this email with the 
  words REMOVE ME as the subject.

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Filter Build Error

2010-03-30 Thread despuestambien
Hello,
After installing plugin sfDoctrineGuardPlugin, it was necessary to do
a new doctrine:build and this error came up.
I searched for it in google, but couldn't find anything.

Has someone any idea? The same happens when we do a doctrine:build --
all

I looked for the file sfDoctrineFormFilterGeneratedTemplate.php the
program is asking, but obviously I couldn't find it..

-
C:\wwwphp symfony doctrine:build-filters
 doctrine  generating filter form classes

  Unable to load sfDoctrineFormFilterGeneratedTemplate.php
generator
template in: C:\www\data/genera
tor/sfDoctrineFormFilter/default/template, C:/www/lib/vendor/symfony/
lib/plugins/sfDoctrinePlugin/data
/generator/sfDoctrineFormFilter/default/template, C:\www\data/
generator/sfDoctrineFormFilter/default/t
emplate, C:/www/lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/data/
generator/sfDoctrineFormFilter/de
fault/template.
-

I tried to omit the fault, but after trying to access the action from
the plugin i mentioned above,
http://localhost/backend_dev.php/sf_guard_user
this error appears:

Fatal error: Class 'sfGuardUserFormFilter' not found in C:\xampp\htdocs
\granitol\lib\vendor\symfony\lib\generator
\sfModelGeneratorConfiguration.class.php  on line 496

Obviously this action, which is a list of users has a filter and
that's why the error didn't show up before.

Thanks a lot 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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: sfWidgetFormInputHidden

2010-03-30 Thread Veríssimo
You are correct, that code from the base class was automatic generated
by symphony. I haven't added any code yet to the extended class.
Perhaps i must overload the  base class with other Widgets and
Validators. I have been reading the Widgets and Validators API, but
there isn't must information there.
I'm trying to resolve this with sub-forms.
Thank you for your help.

On Mar 30, 8:57 am, Gareth McCumskey gmccums...@gmail.com wrote:
 For one you shouldn't define your custom code withing the Base classes
 as far as I know. You should instead create your own classes that
 extend that base class. Maybe Doctrine is different that way as I have
 not used Doctrine at all, but I don't think I am wrong.

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: Invoice Model

2010-03-30 Thread Veríssimo
The echo was just a debug line, but I should only use the embed form
only if the $this-getObject() != null. Because when it is null the
embed form(Invoiceline) is saved with the variable invoiceid = null.

thank you.

On Mar 30, 2:20 pm, Massimiliano Arione garak...@gmail.com wrote:
 You don't need to check.
 The getObject() method returns null if no object associated, and this
 is fine with form instance.
 Just avoid to echo object's id in the form's configure why are you
 doing this???

 cheers
 Massimiliano

 On 30 Mar, 01:07, Veríssimo jveriss...@gmail.com wrote:

  I have implemented this, but i only have the Object after a previous
  have saved it.

  Do i have to do something like check ($this-getObject()) as a object?

    public function configure()
    {
     $subForm = new sfForm();
    for ($i = 0; $i  2; $i++)
    {
      $linharecibo = new Linharecibo();
      $linharecibo-Recibo = $this-getObject(); #This line does not
  have a object the first time
      echo 'Raios'.$linharecibo-Recibo-getId();
      $form = new LinhareciboForm($linharecibo);

      $subForm-embedForm($i, $form);
    }
    $this-embedForm('Linhas', $subForm);

    }

-- 
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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Antoine S.
Hi,

Cool Daniel, I am happy that you confirm this choice.
For multi promotion, the weight is a good idea.
I was thinking of a config file, to say if a promotion are combinable
with the other (matrix). But in fact a matrix with weight would be
perfect..


1. First you need to store the cart in the user session : bad idea
with a database object
Then, an order stays an order (model of the database)
The shopping cart is more interactive and functional (add, remove,
promotion, calcultation..)

2. For me, they are model class. I use PromotionTable to find the
discount.
Then (I have not done this yet) but each promotion could be a class
(as Daniel have done).

On Mar 31, 2:09 am, Tom Haskins-Vaughan t...@templestreetmedia.com
wrote:
 Thanks, guys! That's a great help. I will most probably take you up on
 your offer of help! :)  In the meantime, I have a couple of follow on
 questions:

 1. What do you see the benefits of having a separate cart and order objects?

 2. The Promotion classes were the logic takes place, are they also
 model classes or are they separate classes?

 Thanks again.

 Tom

 On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister nex...@gmail.com wrote:
  Hey Tom,

  I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
  complex promotions setup and took some iterations to get it right. I'd
  be happy to help.

  Our cart works similar to what Antoine said, where the shopping cart
  is distinct from the final order, and mostly responsible for keeping
  track of what's in it for calculating prices (shipping, tax, total,
  etc. - the cart is actually composed of different independent service
  classes to look up shipping,  tax via webservices). Generally we try
  to keep the cart very limited in what it knows about the rest of the
  system.

  The way the promotions work is that they're being applied to the cart
  without the cart knowing much about what is happening. A promotion is
  basically handed the entire cart and it gets to decide whether it
  applies. It does that by using a separate class, a promotion
  criterion, which depending on its type can apply different logic to
  trigger whether it applies. For example, we have promotion criteria
  that trigger based on:
  - a certain cart subtotal
  - whether a certain product is in the cart
  - whether the customer is new
  - etc.
  Those are all different classes, extending a BasePromotionCriterion,
  that are further customizable via parameters from an admin area.

  When the promotion applies, it gets to make changes to the cart. Those
  changes, in turn, depend on the type of the promotion class.
  We have promotions that:
  - apply a cart discount
  - apply a product discount
  - add a free product
  - make shipping free of charge
  - etc.

  By combining criterion classes with promotions classes, and passing a
  few parameters along, you can create virtually any combination of
  promotions, and when you find limitations, you can simply add more
  classes. Plus, this is fairly easy to administer.

  The hardest part is issues like precedence and mutual exclusivity. For
  example, if a promotion applies a cart discount at a certain subtotal,
  then that in turn can lower the subtotal. So, the system needs to be
  smart enough not to remove the promotion again. Or, there are
  szenarios where 2 free shipping promotions are applicable, but the
  system should only apply one (usually the cheaper one, but that can
  vary).
  So, basically we apply weights to classes to figure out in which order
  the promotions apply, and there is an override parameter that enables
  each promotion to override others, for some manual finetuning.
  Sorting that all out is a matter of a series of interesting loops with
  callbacks that cost me a few sleepless nights :)

  Does that help? Let me know if you have any specific questions and I'd
  be happy to help more.
  Daniel

  On Mar 29, 5:56 pm, Tom Haskins-Vaughan t...@templestreetmedia.com
  wrote:
  (sf1.4/Doctrine)

  Hi all,

  Let's say I'm developing an ecommerce solution. I have the following 
  models:

  Order - takes a shopping cart all the way through to an actual order.

  OrderItem - link between the Order and one or more Products

  Product - a catalogue of products

  Promotion - e.g., buy one get one free, or 10% off item, buy these
  both for $10, etc

  The part I'm interested in is the promotions. I *could* do the logic
  in the Order model like so:

  $order = new Order();
  ...
  $order-applyPromotion($promotion);

  But there is likely to be quite a lot of logic, depending on what kind
  of promotion it is (adding OrderItems, discounting Orders, etc), so my
  instinct was to create a PromotionManager class so for example:

  $promoManager = new PromotionManager();
  $promoManager-appyPromotion($promotion, $order);

  Is this a better way to go, or am I causing myself needless abstraction?

  I know there's more than one way to skin a cat, but I'm trying hard to
  get to 

[symfony-users] embeding form by ajax

2010-03-30 Thread Belgacem TLILI
i'm searching for an exemple of how to embed form in a main form using
ajax

i have an idea about but i can't find an exemple to do this

plz 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

To unsubscribe from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Richtermeister
Hey Tom,

any time.

The reason to keep orders and the cart separate is an issue of
separation of concerns, where we're trying to avoid having classes do
too many things (for all the obvious reasons of maintainability,
easier unit testing and future flexibility).

In our system orders are considered part of the persistence layer
(simple propel objects really), so they fundamentally work like data
storage and need to be viewable in different applications (admin area,
customer service, automated export). This makes the order more of a
historic document than an active element, and we feel this describes
better what it really is.

The cart on the other hand is an object that assembles an order, (an
actor), and for that it needs to interact with lots of other objects,
such as the current user (logged in, or guest?), shipping and tax
services, promotions, etc. As you can see, that becomes quite a lot of
code to drag around if you were to make this part of the order, and
none of that is needed any more after an order is placed and post-
checkout life-cycle begins. Also, this would potentially tie orders to
one specific application (at least our cart is aware of the user,
although I guess you could handle that differently).

So, like Antoine said, it's easier to have createOrder() and
loadOrder($order) methods on the cart, and otherwise keep them
separate.
Does that make sense?

As for the promotion classes, in our system there are model classes
which represent a PromotionEvent, and store date and configuration
of a promotion. At runtime, this model class is used to create and
configure a more lightweight promotion class which can only apply
itself to the cart. Same for criteria by the way, one class for
storage, one for runtime. So, for each promotion at runtime you have a
minimum of 4 classes going to work, plus the cart. Plus whatever else
they need to do their job.

The reason for this separation is the same as above. Basically, I look
at propel classes as storage, and I like to code my systems to rely as
little as possible on one particular storage medium. For example, if I
were to switch to Doctrine (no intentions), I would only have to swap
out the dumb classes without touching the ones containing the logic.
Oh, and there's another reason.. for performance reason we cache
promotions between certain checkout steps, and it's easy to serialize
simple objects, while serializing propel objects is both tricky and
introduces potential for stale data.

That help?
Daniel






On Mar 30, 6:09 am, Tom Haskins-Vaughan t...@templestreetmedia.com
wrote:
 Thanks, guys! That's a great help. I will most probably take you up on
 your offer of help! :)  In the meantime, I have a couple of follow on
 questions:

 1. What do you see the benefits of having a separate cart and order objects?

 2. The Promotion classes were the logic takes place, are they also
 model classes or are they separate classes?

 Thanks again.

 Tom

 On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister nex...@gmail.com wrote:
  Hey Tom,

  I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
  complex promotions setup and took some iterations to get it right. I'd
  be happy to help.

  Our cart works similar to what Antoine said, where the shopping cart
  is distinct from the final order, and mostly responsible for keeping
  track of what's in it for calculating prices (shipping, tax, total,
  etc. - the cart is actually composed of different independent service
  classes to look up shipping,  tax via webservices). Generally we try
  to keep the cart very limited in what it knows about the rest of the
  system.

  The way the promotions work is that they're being applied to the cart
  without the cart knowing much about what is happening. A promotion is
  basically handed the entire cart and it gets to decide whether it
  applies. It does that by using a separate class, a promotion
  criterion, which depending on its type can apply different logic to
  trigger whether it applies. For example, we have promotion criteria
  that trigger based on:
  - a certain cart subtotal
  - whether a certain product is in the cart
  - whether the customer is new
  - etc.
  Those are all different classes, extending a BasePromotionCriterion,
  that are further customizable via parameters from an admin area.

  When the promotion applies, it gets to make changes to the cart. Those
  changes, in turn, depend on the type of the promotion class.
  We have promotions that:
  - apply a cart discount
  - apply a product discount
  - add a free product
  - make shipping free of charge
  - etc.

  By combining criterion classes with promotions classes, and passing a
  few parameters along, you can create virtually any combination of
  promotions, and when you find limitations, you can simply add more
  classes. Plus, this is fairly easy to administer.

  The hardest part is issues like precedence and mutual exclusivity. For
  example, if a promotion applies a cart 

[symfony-users] Re: OO conceptual advice

2010-03-30 Thread Richtermeister
Hey Antoine,

yeah, the weight is helpful, because it allows you to quickly declare
certain promotions king.. for example, our subtotal promotion has a
weight of 10, where other promotions range around 1-5 so far, so that
it always gets applied last. As promotions get more similar, the
weight calculations get narrower, and sometimes you get unexpected
results, but at least you're giving your cart a simple mechanism to
decide the order, and you can leave determining the actual weights at
runtime to some other mechanism. This keeps the voodoo to a confined
space in the system ;)

Daniel


On Mar 30, 1:09 pm, Antoine S. antoine.spodobal...@gmail.com
wrote:
 Hi,

 Cool Daniel, I am happy that you confirm this choice.
 For multi promotion, the weight is a good idea.
 I was thinking of a config file, to say if a promotion are combinable
 with the other (matrix). But in fact a matrix with weight would be
 perfect..

 1. First you need to store the cart in the user session : bad idea
 with a database object
 Then, an order stays an order (model of the database)
 The shopping cart is more interactive and functional (add, remove,
 promotion, calcultation..)

 2. For me, they are model class. I use PromotionTable to find the
 discount.
 Then (I have not done this yet) but each promotion could be a class
 (as Daniel have done).

 On Mar 31, 2:09 am, Tom Haskins-Vaughan t...@templestreetmedia.com
 wrote:

  Thanks, guys! That's a great help. I will most probably take you up on
  your offer of help! :)  In the meantime, I have a couple of follow on
  questions:

  1. What do you see the benefits of having a separate cart and order objects?

  2. The Promotion classes were the logic takes place, are they also
  model classes or are they separate classes?

  Thanks again.

  Tom

  On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister nex...@gmail.com wrote:
   Hey Tom,

   I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
   complex promotions setup and took some iterations to get it right. I'd
   be happy to help.

   Our cart works similar to what Antoine said, where the shopping cart
   is distinct from the final order, and mostly responsible for keeping
   track of what's in it for calculating prices (shipping, tax, total,
   etc. - the cart is actually composed of different independent service
   classes to look up shipping,  tax via webservices). Generally we try
   to keep the cart very limited in what it knows about the rest of the
   system.

   The way the promotions work is that they're being applied to the cart
   without the cart knowing much about what is happening. A promotion is
   basically handed the entire cart and it gets to decide whether it
   applies. It does that by using a separate class, a promotion
   criterion, which depending on its type can apply different logic to
   trigger whether it applies. For example, we have promotion criteria
   that trigger based on:
   - a certain cart subtotal
   - whether a certain product is in the cart
   - whether the customer is new
   - etc.
   Those are all different classes, extending a BasePromotionCriterion,
   that are further customizable via parameters from an admin area.

   When the promotion applies, it gets to make changes to the cart. Those
   changes, in turn, depend on the type of the promotion class.
   We have promotions that:
   - apply a cart discount
   - apply a product discount
   - add a free product
   - make shipping free of charge
   - etc.

   By combining criterion classes with promotions classes, and passing a
   few parameters along, you can create virtually any combination of
   promotions, and when you find limitations, you can simply add more
   classes. Plus, this is fairly easy to administer.

   The hardest part is issues like precedence and mutual exclusivity. For
   example, if a promotion applies a cart discount at a certain subtotal,
   then that in turn can lower the subtotal. So, the system needs to be
   smart enough not to remove the promotion again. Or, there are
   szenarios where 2 free shipping promotions are applicable, but the
   system should only apply one (usually the cheaper one, but that can
   vary).
   So, basically we apply weights to classes to figure out in which order
   the promotions apply, and there is an override parameter that enables
   each promotion to override others, for some manual finetuning.
   Sorting that all out is a matter of a series of interesting loops with
   callbacks that cost me a few sleepless nights :)

   Does that help? Let me know if you have any specific questions and I'd
   be happy to help more.
   Daniel

   On Mar 29, 5:56 pm, Tom Haskins-Vaughan t...@templestreetmedia.com
   wrote:
   (sf1.4/Doctrine)

   Hi all,

   Let's say I'm developing an ecommerce solution. I have the following 
   models:

   Order - takes a shopping cart all the way through to an actual order.

   OrderItem - link between the Order and one or more Products

   Product - a 

Re: [symfony-users] Re: OO conceptual advice

2010-03-30 Thread Tom Haskins-Vaughan
On Tue, Mar 30, 2010 at 8:10 PM, Richtermeister nex...@gmail.com wrote:
 Hey Tom,

 any time.

 The reason to keep orders and the cart separate is an issue of
 separation of concerns, where we're trying to avoid having classes do
 too many things (for all the obvious reasons of maintainability,
 easier unit testing and future flexibility).

 In our system orders are considered part of the persistence layer
 (simple propel objects really), so they fundamentally work like data
 storage and need to be viewable in different applications (admin area,
 customer service, automated export). This makes the order more of a
 historic document than an active element, and we feel this describes
 better what it really is.

 The cart on the other hand is an object that assembles an order, (an
 actor), and for that it needs to interact with lots of other objects,
 such as the current user (logged in, or guest?), shipping and tax
 services, promotions, etc. As you can see, that becomes quite a lot of
 code to drag around if you were to make this part of the order, and
 none of that is needed any more after an order is placed and post-
 checkout life-cycle begins. Also, this would potentially tie orders to
 one specific application (at least our cart is aware of the user,
 although I guess you could handle that differently).

 So, like Antoine said, it's easier to have createOrder() and
 loadOrder($order) methods on the cart, and otherwise keep them
 separate.
 Does that make sense?

But what if you want to change the shipping or add an item after the
customer has placed an order? The order is still acting like a cart
even though it is now technically an order. I took over a Codeigniter
project that has a separate cart and order and there is a lot of
duplication of code. For example the ability to apply a promotion to
both cart (before checkout) and an order (after checkout).  Granted,
the project is quite poorly written but still I'm thinking I can avoid
this by taking an order from cart to delivery.


 As for the promotion classes, in our system there are model classes
 which represent a PromotionEvent, and store date and configuration
 of a promotion. At runtime, this model class is used to create and
 configure a more lightweight promotion class which can only apply
 itself to the cart. Same for criteria by the way, one class for
 storage, one for runtime. So, for each promotion at runtime you have a
 minimum of 4 classes going to work, plus the cart. Plus whatever else
 they need to do their job.

I was also thinking of having a Promotion table which would hold the
config info. Then I would apply the promo to the order with the
PromoManager. So you'd pass the Promo and Order to the PromoManager.
Then depending on the promo type, the Promo manger loads the relevant
sub class e.g. PromoManagerGiftWithPurchase. With our current project
you can only have one promo code, but I guess using weights would be a
good way to manage multiple promos.

In the action:

$promoManager = new PromoManager();
$promotion= Doctrine::getTable('Promotion')-getByCode($code);

$order = $promoManager-applyPromo($order, $promotion);

then in the PromoManager:

protected function getPromoClass($promotion)
{
  $promoClassName = $promotion-class_name;
   ...
   $this-promoClass = new $promoClassName();
}

Is this similar to what you're doing? or not at all?


 The reason for this separation is the same as above. Basically, I look
 at propel classes as storage, and I like to code my systems to rely as
 little as possible on one particular storage medium. For example, if I
 were to switch to Doctrine (no intentions), I would only have to swap
 out the dumb classes without touching the ones containing the logic.
 Oh, and there's another reason.. for performance reason we cache
 promotions between certain checkout steps, and it's easy to serialize
 simple objects, while serializing propel objects is both tricky and
 introduces potential for stale data.

 That help?
 Daniel






 On Mar 30, 6:09 am, Tom Haskins-Vaughan t...@templestreetmedia.com
 wrote:
 Thanks, guys! That's a great help. I will most probably take you up on
 your offer of help! :)  In the meantime, I have a couple of follow on
 questions:

 1. What do you see the benefits of having a separate cart and order objects?

 2. The Promotion classes were the logic takes place, are they also
 model classes or are they separate classes?

 Thanks again.

 Tom

 On Tue, Mar 30, 2010 at 2:00 AM, Richtermeister nex...@gmail.com wrote:
  Hey Tom,

  I wrote the ecommerce part ofwww.skinmedica.com, which uses a quite
  complex promotions setup and took some iterations to get it right. I'd
  be happy to help.

  Our cart works similar to what Antoine said, where the shopping cart
  is distinct from the final order, and mostly responsible for keeping
  track of what's in it for calculating prices (shipping, tax, total,
  etc. - the cart is actually composed of different independent service