Hi there,

I am a developer from the Netherlands working on a project for a
client. I'm experiencing a weird problem concerning Doctrine behaviors
in Symfony 1.4.8 and 1.4.9. I have a blogpost class that I'm giving
commentable behavior. This behaviour consists of 3 methods that are
used to simply the retrieval of comments about the blogposts. The
strange thing about it, is that the methods in my behavior class are
not called when I provide a parameter that has the value: zero, null
or false.

I noticed the magic method __call($method, $arguments) in the
sfDoctrineRecord gets called to handle my 'getComments' method call.
Almost at the end of the function the following code is called (my
values in comments):

// when $blogPost->getComments(0); is called
call_user_func_array(
array($this, $verb), // $this->'get
array_merge(array($entityName), $arguments) // array('comments', 0)
)

This actually calls the get($fieldName, $load = true) and further the
__get($fieldName, $load = true) methods of the Doctrine_Record class.
My origional parameter from my getComments(0) call is available in
these methods as the $load parameter and in the try/catch section of
the method it is interpreted as the boolean false!!! This results in
the $blogPost->getComments() returning null...

Does anyone know what is going wrong here and how I can use parameters
with values like 0/null/false in my behaviour methods?

Many thanks in advance!


Gijs Nieuwenhuis

-- 
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to