From: Floyd Resler on

On Jul 22, 2010, at 3:14 PM, Marc Guay wrote:

>> i recommend propel
>> http://www.propelorm.org/
>
> Holy Moses that thing is a monster. It requires installing extra
> libraries (Phing) in order to create an XML schema reverse-engineered
> from my existing database. The code looks simple enough but that
> installation is brutal. Any other suggestions? I'm thinking of
> sticking with good ol' hand coding and a few helper classes.
>
> Marc
>

I kind of had the same reaction when I saw it! I started playing around with it and realized that if I ever make any database changes I'm going to have to regenerate everything! Seems a bit cumbersome to me but I'm an "good ol' hand coding and a few helper classes" programmer myself! I wound up creating a very light-weight yet flexible framework that has served me well over the past few years. I've been thinking about releasing it but it doesn't follow the traditional model of most of the MVC frameworks I've seen.

Take care,
Floyd

From: Nathan Nobbe on
On Thu, Jul 22, 2010 at 1:14 PM, Marc Guay <marc.guay(a)gmail.com> wrote:

> > i recommend propel
> > http://www.propelorm.org/
>
> Holy Moses that thing is a monster. It requires installing extra
> libraries (Phing) in order to create an XML schema reverse-engineered
> from my existing database. The code looks simple enough but that
> installation is brutal. Any other suggestions? I'm thinking of
> sticking with good ol' hand coding and a few helper classes.
>
> Marc
>

so you spend a little time up front to sav tons of coding time in the
future... change your schema; re-generate the base layer.., o yeah, and it
preserves custom logic too (upon regeneration), since that resides in sub
classes.

i used to hand write db wrapper classes but found it tedious and tended to
result in a lack of cohesion through the classes themselves, not to mention
being error prone.

-nathan
From: Peter Lind on
On 22 July 2010 21:14, Marc Guay <marc.guay(a)gmail.com> wrote:
>> i recommend propel
>> http://www.propelorm.org/
>
> Holy Moses that thing is a monster.  It requires installing extra
> libraries (Phing) in order to create an XML schema reverse-engineered
> from my existing database.  The code looks simple enough but that
> installation is brutal.  Any other suggestions?  I'm thinking of
> sticking with good ol' hand coding and a few helper classes.
>

Let me repeat myself: did you have a look at Doctrine2?

Regards
Peter

--
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
</hype>
From: Marc Guay on
> Let me repeat myself: did you have a look at Doctrine2?

Hi Peter,

I didn't mean to ignore your suggestion, I just got extremely
overwealmed by the Doctrine website and didn't even have a response.
I get the impression that, like Zend and others, learning how to
install and use that would take longer than my 'little' website is
worth. Maybe someday when I'm working for a more patient employer
who's willing to pay me to learn. Insert laughter here.

Marc
From: Shawn McKenzie on
On 07/22/2010 08:35 AM, Marc Guay wrote:
> Hi everyone,
>
> I've built a fairly large normalized database schema for a project.
> This is fun for me as I like thinking about how everything is
> interconnected. Foreign keys are all set up, many-to-many tables are
> go, etc, and so on. But now it's time to create an interface between
> that database and the website using PHP. I've searched the web and
> this is obviously a very common problem with many solutions, but I
> can't help but feel that all of the logic I've built into the database
> is worth nothing once I start coding. I found this
> article/presentation that essentially sums up my frustration:
> http://mag-sol.com/talks/lpm/2006/orm/. Up until now I've been
> working on smaller projects with only a few tables that don't really
> relate to each other, and have found this tool
> (http://www.ricocheting.com/code/php/mysql-database-class-wrapper)
> very handy for the reasons he explains, but I'm looking for something
> a little different. I've looked at RedBean and it seems pretty handy,
> but it also requires me to redefine all of the foreign keys I've
> already defined, which is annoying. Any hope of something like
>
> // Get company where name='Widgets Inc.' or id=1 or....
> $company = $db->get_company("name='Widgets Inc.'");
>
> // Get all clients joined to the company
> $clients = $company->get_clients();
>
> // Get all projects joined to the client
> $projects = $clients->get_projects();
>
> ?

You may not want a full fledged framework, but I would recommend
CakePHP. Now they have naming conventions for tables/columns, that if
you follow, makes it sooo easy, but if you already have your schema
built it can use that just as easily.

Just run the cake script, enter db details, it will enumerate tables and
columns and ask which are related by which keys and even let you enter
validation rules etc. It then builds a skeleton app with all the models
for your schema and will even generate test.

--
Thanks!
-Shawn
http://www.spidean.com