[symfony-users] Re: Performance & ORM for Symfony 1.3

2009-10-26 Thread Gareth McCumskey
Just remember one thing. Don't do your benchmarks using the dev front controller. The dev controller has no caching, loads additional global variables to keep track of request/response info and other debug information. The best test is to benchmark on the production front controller as this is wher

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
Thanks a lot, I was sooo into doctrine that I forgot that php can issue warnings as well ;) Again thanks On Oct 27, 7:06 am, Alexandre SALOME wrote: > Yes, > > A strict PHP object standard is "when you overload a method, you must set > the same "signature" : > >    - same method name >    - same

[symfony-users] Re: how to build a form for multiple uploads?

2009-10-26 Thread mel_06
i tried searching but unfortunately there's too little documentation for symfony at the moment. On Oct 26, 7:14 pm, Alexandre SALOME wrote: > You can have a look at upload plugins in the plugins repository on website. > > Maybe you fill find a plugin that fill your needs. > > Otherwise, sourceco

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Richtermeister
It means the "signature" of your save method is different. Make sure you take the same parameters as the parent function. Daniel On Oct 26, 6:19 am, mbernasocchi wrote: > thanks, it works as expected, I just had to add > return parent::save($conn); instead of only parent::save($conn); to be >

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
ok, sure... so i guess that all the signin code should be here, in myUser class, and not in the signin module... anyway, i'll have a deep look at the sfGuardSecurityUser.class.php code. thanks very much for your time! On Oct 27, 12:35 am, Frank Stelzer wrote: > look in the signin method, this

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
look in the signin method, this attribute is saved there: " $this->setAttribute('user_id', $user->getId(), 'sfGuardSecurityUser');" Ok i think the rest is really search and find stuff and should not be discussed on this public list furthermore. Am 27.10.2009 um 00:28 schrieb lorenx: > > d

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
don't you think you've finished with me! :P $id = $this->getAttribute('id', null, 'MyCustomUser') does not return any id... :( i've even tried: $this->getAttribute('id', null, 'sfGuardSecurityUser') and $this->getAttribute('user_id', null, 'sfGuardSecurityUser') On Oct 27, 12:11 am, Frank Ste

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread david
This is handy snippet that allows module based css to be included - a handy way to reuse style & (when extended) js. http://snippets.symfony-project.org/snippet/306 On Tue, 27 Oct 2009 00:00:23 +0100, Sid Ferreira wrote: > Alexandru, see, I'm not disappointed, but excited. I've just found wa

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
eureka! :) Am 27.10.2009 um 00:06 schrieb lorenx: > > do you mean somethig like this? > > class myUser extends sfBasicSecurityUser > { >protected $user = null; > >public function getCustomUser() { >if (!$this->user && $id = $this->getAttribute('id', null, > 'MyCustomUser')) { >

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
Yes, A strict PHP object standard is "when you overload a method, you must set the same "signature" : - same method name - same arguments - same types To make simple, you must copy/paste the function declaration line of sfDoctrineForm.class.php : public function save(...) to yourForm

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
do you mean somethig like this? class myUser extends sfBasicSecurityUser { protected $user = null; public function getCustomUser() { if (!$this->user && $id = $this->getAttribute('id', null, 'MyCustomUser')) { $this->user = MyCustomUserPeer::retrieveByPk($id);

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Sid Ferreira
Alexandru, see, I'm not disappointed, but excited. I've just found ways to improve my work! I have too few time to research, so, anything like this is like gold :D On Mon, Oct 26, 2009 at 20:51, Eno wrote: > > On Mon, 26 Oct 2009, Sid Ferreira wrote: > > > David: Could you share with me how you

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
Yes "Add a method in your myUser class for retrieving an according and valid instance of your guard user entry and thats it (see getGuardUser)." ... guard user is your custom user. Am 26.10.2009 um 23:55 schrieb lorenx: > > mmm, > but i don't have any getCustomUser() method; > it seems

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
mmm, but i don't have any getCustomUser() method; it seems that it should return a MyCustomUser instance... On Oct 26, 11:45 pm, Frank Stelzer wrote: > You do not have to re-implement those methods, as your model class has   > it already done. > > You cann access them via: > > $this->getUser()-

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Eno
On Mon, 26 Oct 2009, Sid Ferreira wrote: > David: Could you share with me how you use it? Single domain, one app for > each domain/subdomain... I wanna find out where I may be doing something > wrong :D There is no "wrong" or "right" way it depends on how you want to organize code. Maybe differ

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
You do not have to re-implement those methods, as your model class has it already done. You cann access them via: $this->getUser()->getCustomUser()->getEmail(); or add wrapper methods in your myUser class: myUser: --- public function getEmail() { return $this->getCustomUser()->getEmail()

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
> 3. Add a "getCustomUser" method to your myUser class and generate the   > mentioned link in this way. sorry but... if i need a (custom) getUsername() or a getEmail() method, do i need to re-implement these methods from scratch in myUser class although i already have them in MyCustomUser class?

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
> here my problem is that it does not seem possible to extend "my custom > user class" to sfBasicSecurityUser cause it already extends its base > class! > i'm stuck here... 1. Take the myUser class and extend it from sfBasicSecurityUser as it is by default. 2. Leave your MyCustomUser model clas

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
> The "myUser" class handles all security and session related stuff. It   > does not know any model specific details, as there might be something   > like a username field or an email field in some database table. ok. > The "guard" user (the one you already have implemented) is the one,   > whic

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Sid Ferreira
Now, that's a nice trick!!! On Mon, Oct 26, 2009 at 19:45, Greg Maruszeczka wrote: > On Mon, 26 Oct 2009 19:26:55 -0200 > Sid Ferreira wrote: > > > Hi everyone! Well, there's a while that I always use only one app. > > Even in the admin I use routes instead of another app. > > > > The reason to

[symfony-users] Re: custom query using sql functions

2009-10-26 Thread Ari Army
Thanks guys!, both solutions look good, going to use first 'CUSTOM' option to cut down on expensive LIKE queries. On Mon, Oct 26, 2009 at 5:16 PM, Alexandru-Emil Lupu wrote: > http://forum.symfony-project.org/index.php/m/23667/ > > --~--~-~--~~~---~--~~ You rece

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Alexandru-Emil Lupu
Sid, i don't wanna disapoint you, but i guess you're the only one. For the "js", css, uplads and so on, there is a directive called "alias" in apache example: Alias /sf /srv/symfony/1.2/data/web/sf AllowOverride All Allow from All alternatively you can do 2-3 things l

[symfony-users] Re: custom user class

2009-10-26 Thread Frank Stelzer
Hi, You have to understand the purposes of the two different user classes: The "myUser" class handles all security and session related stuff. It does not know any model specific details, as there might be something like a username field or an email field in some database table. The "guard"

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread david
Usually a simple approach. Once frontend app per logical domain (subdomain & business domain are usually the same for apps we develop), a single back-end application for admins. You don't often need full CRUD in every sf application - and keeping things separate helps reduce risk. Extensiv

[symfony-users] Re: Multiple cultures

2009-10-26 Thread HAUSa
Hmm, I don't think you understand me. Or I just don't get it yet :) Two users: one from France (language FR), one from Holland (language NL) The website supports three languages: EN, FR and NL FR guy submits his advertisement in EN and FR Now the NL guy wants to view this advert. Because his cul

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Greg Maruszeczka
On Mon, 26 Oct 2009 19:26:55 -0200 Sid Ferreira wrote: > Hi everyone! Well, there's a while that I always use only one app. > Even in the admin I use routes instead of another app. > > The reason to that is that I don't want to duplicate files (CSS and > JS), and so far didn't found a way to con

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread Sid Ferreira
David: Could you share with me how you use it? Single domain, one app for each domain/subdomain... I wanna find out where I may be doing something wrong :D On Mon, Oct 26, 2009 at 19:32, david wrote: > > Yes :P > > On Mon, 26 Oct 2009 22:26:55 +0100, Sid Ferreira > wrote: > > > Hi everyone! Wel

[symfony-users] Re: custom user class

2009-10-26 Thread lorenx
thank you very much for your reply, but... i already tried the sfGuardPlugin plugin and now i'd like to implement my own user management. how to bing my user class to the system one? On Oct 26, 9:43 pm, Alexandru-Emil Lupu wrote: > The ACL system is very simple ... > You have 2 types of permis

[symfony-users] Re: Do you use more than one app?

2009-10-26 Thread david
Yes :P On Mon, 26 Oct 2009 22:26:55 +0100, Sid Ferreira wrote: > Hi everyone! Well, there's a while that I always use only one app. > Even in the admin I use routes instead of another app. > > The reason to that is that I don't want to duplicate files (CSS and JS), > and > so far didn't found

[symfony-users] Do you use more than one app?

2009-10-26 Thread Sid Ferreira
Hi everyone! Well, there's a while that I always use only one app. Even in the admin I use routes instead of another app. The reason to that is that I don't want to duplicate files (CSS and JS), and so far didn't found a way to config the web/admin/index.php to use the css inside the web/ folder.

[symfony-users] Re: custom query using sql functions

2009-10-26 Thread Alexandru-Emil Lupu
http://forum.symfony-project.org/index.php/m/23667/ On Mon, Oct 26, 2009 at 7:15 PM, Ari Army wrote: > Hey all, > I was wondering if this can be done via Propel's Peer classes... > > WHERE > NO1='302-3001' > AND > NO2=2892 > AND -- the PART below is where i stumble > LOWER( SUBSTR(FIRSTNAME,1,1)

[symfony-users] Re: Multiple cultures

2009-10-26 Thread david
Which means that the list of preferred cultures comes from the advert - rather than from the site On Mon, 26 Oct 2009 21:12:56 +0100, HAUSa wrote: > > That is not what I mean. When a user submits an advertisement, he/she > must enter it in his own local language (for example FR) and fo

[symfony-users] Re: custom user class

2009-10-26 Thread Alexandru-Emil Lupu
The ACL system is very simple ... You have 2 types of permissions: - user permissions and group permissions. When the user logs in, the system automatically compiles the permissions and stores on the session. check here http://trac.symfony-project.org/browser/plugins/sfGuardPlugin/branches/1.2/lib

[symfony-users] custom user class

2009-10-26 Thread lorenx
hi all, i know this is a dangerous way but... how to create and use my own user class? i read that i need to make MyCustomUser class extends sfUser (or sfBasicSecurityUser?) but MyCustomUser class already extends BaseMyCustomUser that, in turn, extends BaseObject. i also read to change the user

[symfony-users] Re: Multiple cultures

2009-10-26 Thread HAUSa
That is not what I mean. When a user submits an advertisement, he/she must enter it in his own local language (for example FR) and for EN. When a dutch user (language NL) views the advertisement, there will ofcourse be no NL i18n content be submitted. So then Symfony has to display the EN info. Bu

[symfony-users] Re: Performance & ORM for Symfony 1.3

2009-10-26 Thread Puentes Diaz, Roberto G. (puentesd...@gmail.com)
Hi Fabien ! On 21 oct, 03:05, Fabian Lange wrote: > Hi Roberto, > I have a hard time understanding your numbers. > You say you generate a benchmark file in the front controller which > just writes how long the page took to load? > Which unit is that time? Is it bad? Is there any change when invo

[symfony-users] custom query using sql functions

2009-10-26 Thread Ari Army
Hey all, I was wondering if this can be done via Propel's Peer classes... WHERE NO1='302-3001' AND NO2=2892 AND -- the PART below is where i stumble LOWER( SUBSTR(FIRSTNAME,1,1) )='b' AND LOWER( SUBSTR(LASTNAME,1,1) )='r' tried something like this before realized even though $first_initial is low

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
thanks, it works as expected, I just had to add return parent::save($conn); instead of only parent::save($conn); to be able to use the object in a template. the only thing is that i stll get the same warning about the strict standard: Strict Standards: Declaration of OpenBubbleForm::save() should

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
The idea : class PostForm { protected $author; public function setAuthor($author) { $this->author = $author; } public function save(Doctrine_Connection $conn = null) { if ($this->author !== null) { $this->getObject()->setAuthor($this->author); } parent::save

[symfony-users] Re: DOCTRINE - load data to tables which has got a relation !!

2009-10-26 Thread dziobacz
Alexandre thx a lot :) david also thx but I use Alexandre idea :) On 26 Paź, 12:22, david wrote: > If you add a foreign alias to your relation then it's even easier... > > >   relations: > >     sfGuardUser: > >       class: sfGuardUser > >       local: user_id > >       foreign: id > >       t

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
thanks a lot, I see how to handle it now, just putting the save method as you said gives me the following warning: Strict Standards: Declaration of OpenBubbleForm::save() should be compatible with that of sfFormDoctrine::save() in /home/me/ nosoapnobubbles/trunk/lib/form/doctrine/OpenBubbletForm.c

[symfony-users] Re: Multiple cultures

2009-10-26 Thread david
The trick with cultures is knowing what happens when, the reasons why - and understanding where your code fits into the cycle. There's a negotiation that happens between the browser and the server - where they quiz each other about what cultures the browser has been configured with - and wh

[symfony-users] Doctrine - Database migration version

2009-10-26 Thread Simone Fumagalli
I've just entered the migrations world. Everything is clear to me ... the only thing I haven't realized yet is how do I get the version for the database in my project ? Regards -- Simone --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[symfony-users] Re: DOCTRINE - load data to tables which has got a relation !!

2009-10-26 Thread david
If you add a foreign alias to your relation then it's even easier... > relations: > sfGuardUser: > class: sfGuardUser > local: user_id > foreign: id > type: one > onDelete: CASCADE > onUpdate: CASCADE foreignAlias: Profile > sfGuardUser: > d

[symfony-users] Re: how to build a form for multiple uploads?

2009-10-26 Thread Alexandre SALOME
You can have a look at upload plugins in the plugins repository on website. Maybe you fill find a plugin that fill your needs. Otherwise, sourcecode will help you to find an approach. Alexandre 2009/10/26 mel_06 <06melc...@gmail.com> > > i'm just new to symfony, used to code igniter before. >

[symfony-users] Re: DOCTRINE - load data to tables which has got a relation !!

2009-10-26 Thread Alexandre SALOME
1. You mustn't set "1" as user_id" but the alias "dziobacz". 2. You mustn't set id column 3. You must set different names for fixtures. 4. You must use relation names for fixtures Well, let's rewrite : sfGuardUser: sgu_dziobacz: username: dziobacz password: haslo123 sfGuardU

[symfony-users] DOCTRINE - load data to tables which has got a relation !!

2009-10-26 Thread dziobacz
I have got table sfGuardUser and sfGuardUserProfile. Table sfGuardUserProfile in schema.yml: sfGuardUserProfile: columns: id: type: integer(4) primary: true autoincrement: true user_id: type: integer(4) default: '' notnull: true unique: true

[symfony-users] Multiple cultures

2009-10-26 Thread HAUSa
Is it possible to set multiple cultures for users? For example first the culture FR, then the culture EN. When a Propel object is not available in FR, it automatically takes the EN value. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[symfony-users] Re: Column type 'char' mistreated by Doctrine.

2009-10-26 Thread nervo
FYI, in Doctrine, mysql "char" is obtained by : type: string fixed: true Without "fixed: true", its just "varchar". Il also could be important to specify string length like this : type: string(10) fixed: true On Oct 25, 11:23 am, ColinFine wrote: > The "symfony and Doctrine" book, in chapter

[symfony-users] Re: Redirect from component

2009-10-26 Thread Gareth McCumskey
Components are designed to be a once off type of functionality where a helper needs data generated in order to fully display. Its designed not to worry about routing etc as a performance improvement over the regular action->template system. If you need a partial to submit data to a component rathe

[symfony-users] how to build a form for multiple uploads?

2009-10-26 Thread mel_06
i'm just new to symfony, used to code igniter before. i'm doing a multiple upload but i'm really stuck on how i will do my form for this. i do hope for someone's help. thanks in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[symfony-users] Re: Redirect from component

2009-10-26 Thread Alexandre SALOME
The answser is just no. Component are not supposed to handle routing logical. Refactor your code 2009/10/26 HAUSa > > Is it possible to redirect from a component? > Because the redirect() function doesn't work (Call to undefined method > systemComponents::redirect) > > > -- Alexandre Salomé

[symfony-users] Redirect from component

2009-10-26 Thread HAUSa
Is it possible to redirect from a component? Because the redirect() function doesn't work (Call to undefined method systemComponents::redirect) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "symfony users" group. To

[symfony-users] Re: IDE NetBeans supports Symfony what's about propel

2009-10-26 Thread deresh
i have reported to Netbeans bug tracker an enhancement so there is a switch to choose ORM when generating new projects with symfony 1.3 or higher On Oct 25, 3:46 pm, Maras wrote: > Anyone knows how to create symfony project iwith ORM Propel. n > Netbeans with ORM Propel. When I check command lis

[symfony-users] Re: set sf_user id to a doctrine model

2009-10-26 Thread Alexandre SALOME
You must set the user ID after saving. A possible solution would be to pass a sfGuardUser on saving of form : class PostForm { // ... public function save($author, Doctrine_Connection $conn = null) { $this->setAuthor($author); $this->save($conn); } } Another way would be to add a

[symfony-users] set sf_user id to a doctrine model

2009-10-26 Thread mbernasocchi
Hi, I've a Post model in my app, I need to set the author Id of the post to the id of the logge user (as in any forum). I succeeded by overwriting the save() method of the Post.class.php and making it like this: public function save(Doctrine_Connection $conn = null) { if ($this->isNew())