[symfony-users] Re: How to determine if an object member value is empty?

2010-12-27 Thread Gabriel Petchesi
You have http://php.net/manual/en/function.is-null.php to check for null values and for empty strings you just do $a !== gabriel -- 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

Re: [symfony-users] How to determine if an object member value is empty?

2010-12-27 Thread YUKI Kaoru
Hi benze. If I get a row from the db, how do I check if the value is blank/ null? Ex: $object-getUserId() How about this? empty($object-user_id) Yuki -- 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] Re: How to retrieve / edit / delete an object only if the user is the creator ?

2010-12-27 Thread Tristan
Ok so I need to write in my preExecute() (Doctrine) public function preExecute() { parent::preExecute(); // do i need to retrieve the query with : // $q = $this-getQuery(); $q-Where(created_by = ?, $this-getUser()-getId() $q-execute(); } Is that check enough ? I mean, do

[symfony-users] symfony and memcache doubt

2010-12-27 Thread Shihab KB
Hi, We have created a restful web service using symfony (symfony 1.4 and doctrine ORM) for a content management system. Clients from various location of the world access the data of the content management system thru the restful apis. Each time of api call the data base query is required. We are

[symfony-users] [symfony2] FileField issue

2010-12-27 Thread Thomas Rabaix
Hello, I am trying to use the FileField object, every thing works fine, however I cannot have the correct file name. I have a model with a property `binary_content`, then I create a form with a FileField named `binary_content`. When the form is bound, the object property get the temporary

[symfony-users] Re: How to retrieve / edit / delete an object only if the user is the creator ?

2010-12-27 Thread dmitrypol
Here is how I did it in my edit method. But I like your idea of using preExecute. public function executeEdit(sfWebRequest $request) { $user_id = $this-getUser()-getGuardUser()-getId(); $request_id = $request-getParameter('id'); if ($user_id == $request_id )

[symfony-users] Re: How to retrieve / edit / delete an object only if the user is the creator ?

2010-12-27 Thread Gabriel Petchesi
I think the filtering code in preExecute (model layer) is not ok. In my opinion you need to make changes in a couple of places: 1. Filters Make sure the filter always includes the user_id in the list of conditions. See the getFilters() function in the autogenerated backend code. This solves

[symfony-users] Re: How to retrieve / edit / delete an object only if the user is the creator ?

2010-12-27 Thread Tristan
Thanks for your help, i'll try that ;) On 27 déc, 14:49, Gabriel Petchesi pghora...@gmail.com wrote: I think the filtering code in preExecute (model layer) is not ok. In my opinion you need to make changes in a couple of places: 1. Filters Make sure the filter always includes the user_id in

Re: [symfony-users] [symfony2] FileField issue

2010-12-27 Thread Tim Nagel
You have to move the file into a proper location. I hit this issue too. I assume that the file upload component isnt finished yet, so on my file object (which contains $this-file for the path of the file) i have a move function: public function move($newPath, $uniqid = false) {