[Solar-talk] Solar_Sql_Table initial rows
Antti Holvikari
anttih at gmail.com
Tue Jul 11 13:55:43 PDT 2006
On 7/11/06, Paul M Jones <pmjones at solarphp.com> wrote:
> On Jul 11, 2006, at 1:04 PM, Antti Holvikari wrote:
>
> > 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.
>
> If you're using the PEAR installer, there is a post-install hook you
> can run. Here's a place to start ...
>
> http://greg.chiaraquartet.net/archives/5-Post-install-Scripts-in-
> PEAR-1.4.0.html
>
> ... but that may not be the right thing for you.
This was my choise until I realised that it would make absolute sense
to create the rows on the fly when creating the tables.
> > 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?
>
> You're probably right. _postCreate() perhaps?
That sounds reasonable :-)
> Having said that, I think that Solar_Sql_Table is due for refactoring
> again; the internal validations, etc. need some work (as Jeff
> Surgeson will attest), and the _autoCreate()/_autoSetup() could
> certainly be more intuitive code-wise. I'm thinking that S_S_Table
> needs to be a bit more stripped-down to a generic case, and then have
> a new Solar_Model class that adds on top of it. That lets other
> vendors (like you) pick their level of functionality (generic Table
> or more full-featured Model), and then build on it. (Does that make
> sense?)
It makes sense. I would like to hear more about what you have in mind.
Are we getting towards an ORM? ;-) I'm a little scared of those...
--
Antti Holvikari <http://antti.dotgeek.org/blog>
Zend Certified Engineer (ZCE)
More information about the solar-talk
mailing list