[Solar-talk] Solar_Inflect class, and Models

Dmytro Konstantinov umka.dk at gmail.com
Sat May 3 11:16:08 CDT 2008


Personally, I haven't used Solar_Inflect yet, so I guess the change is  
making no difference to me. In principle, I quite like the idea. Plus,  
as far as fallback behaviour goes it seems like a really sensible  
option! Quite loking forward to giving it a go!

Dmytro


On 3 May 2008, at 16:46, Paul M Jones wrote:

> Hi guys,
>
> Antti and Andreas noticed earlier this week, but I wanted to point  
> it out for those who didn't see:  I have resurrected the old  
> Solar_Inflect class from last year.  This class provides methods to  
> convert between singular and plural forms of English words.
>
> The original intent behind the inflector was to automatically set  
> table and column names in model classes, so that you wouldn't need  
> to specify (e.g.) that "user_id" was the column name for foreign  
> keys relating to a "Users" mode on a "has many users" relation.
>
> After much discussion on its initial introduction, we all figured  
> that explicit naming would be a  much better plan, especially in  
> light of non-English speakers.  You can see part of that discussion  
> here ...
>
>  <http://mailman-mail3.webfaction.com/pipermail/solar-talk/2007-February/002328.html 
> >
>
> ... and it ended with me saying how the tyrant submits to the will  
> of the people. ;-)
>
>  <http://mailman-mail3.webfaction.com/pipermail/solar-talk/2007-February/002349.html 
> >
>
> Now that we've had it in place for about a year, and all the  
> explicitness is in place, I would like to add a layer of  
> implicitness for convenience.
>
> All the existing relationship description keys will remain, and the  
> existing behavior will stay as it is.  However, if a foreign-key or  
> foreign-class key is empty, I'd like to fall back to using  
> Solar_Inflect to pick out the right class and key names from the  
> relationship name.
>
> I think it was the right call to leave inflection out of it while  
> getting the underlying work done.  But now that the implementation  
> is so well-defined, I think it would be a good thing to have  
> inflection back as a convenience.  (If nothing else, I personally  
> will find this helpful.)
>
> Are there any strong objections or arguments against having implicit  
> inflection in addition to (and not in place of) the existing  
> explicit behavior?  The explicit behavior will take precedence, of  
> course.
>
>
> -- pmj
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk



More information about the Solar-talk mailing list