I had posted something similar to this to the cakephp-core group a week or 
so ago, but I think it got swallowed up, so here goes.

I do a bit of work with CakePHP and legacy PHP projects.  A part of the fun 
with that is working in legacy table names that don't work well with the 
CakePHP convention.  For the most part, CakePHP handles this just fine, 
with the usage of Model::useTable and Model::primaryKey.

However, generating fixtures isn't quite up to scratch.  The bake shell for 
fixtures will only look at the table in the datasource to determine the 
name of the model and the fixture.  If my table name is an inappropriate 
comp_patient, and I've created a model called Patient, I'd like to be able 
to generate a fixture for Patient from the bake command, rather than have 
to generate a CompPatient fixture, and manually rename and update the class 
name.

I've started work a on plugin that will allow generation of fixtures, based 
on the models you already have generated in your Model directory, rather 
than the datasource.  The basics appear to work, but I need to generate the 
unit tests before it gets released to the general public.

What I'd really like to do is modify the core, as a contribution, and have 
the bake shell recognise if a generated model uses a table in the table 
list, then it should use the name of that model to generate the fixture, 
rather than the model name that would normally be generated from the table 
name.

I'm hoping this gets the attention of a CakePHP core developer or two.

Would this be a welcome addition to the core, or should I just stick with 
my plugin?

Regards
Reuben Helms

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to