[Solar-talk] Solar_Sql_Table initial rows

Antti Holvikari anttih at gmail.com
Tue Jul 11 13:04:00 PDT 2006


On 7/11/06, Paul M Jones <pmjones at solarphp.com> wrote:
> On Jul 11, 2006, at 5:21 AM, Antti Holvikari wrote:
>
> > Would it make sense to add a method to Solar_Sql_Table that user could
> > implement to be able to insert some data to the table. I see it could
> > run just before _autoCreate returns true. Or is there a solution for
> > this already?
>
> I had never thought of it, really.  I suppose one could override
> _autoCreate() and then insert new rows if the parent returned true.
> I don't think I've ever needed it myself, but it's an interesting
> idea; do you have suggestions on how to implement, or use-case
> narratives?

I need it for inserting a row to my users table. I know, I need to
think it security-wise, but I really need to get that first user to
the table somehow. Also, I've seen a few projects that need some data
in the tables to work properly. One example would be a blog app which
would insert a "Welcome to your blog!" entry into the entrys table.

I could override _autoCreate but it isn't that convenient, checking
for that bool from the parent. Maybe a new method is what we need?


-- 
Antti Holvikari <http://antti.dotgeek.org/blog>
Zend Certified Engineer (ZCE)


More information about the solar-talk mailing list