Comment 2 by Loïc d'Anterroches, Apr 8, 2009
The only problem I see at the moment is that I wanted to be able to use the get method with multi-field based primary keys. This will conflict. I think a simple getOne() method would be better. I am still ensure with the null or Exception in case of error.
Labels: Type:Enhancement, -Type:Defect
Summary: Proposal: get method
Summary: Proposal: get method
Comment 3 by Bruno, Apr 8, 2009
I see. There is also the possibility to check if the parameter is a $key=>$value array or a simple list, but I admit it is a bit tricky. get() returns false if the result length is 0... Wouldn't getOne()'s behaviour be the same ?
Comment 4 by Loïc d'Anterroches, May 15, 2009
Bruno, what about making the method a static method? This make more sens as we do not need to create first a model on the stack to then get the model we want. I will implement in a static way and you will tell me what you think about it.
Comment 5 by Loïc d'Anterroches, May 15, 2009
Added in commit 7aa17fc. Pas en statique car __CLASS__ dans un appel statique à une méthode va être dans ce cas Pluf_Model car la méthode est définie dans cette class.
Status: Fixed
Sign in to reply to this comment.
Reported by Bruno, Apr 8, 2009