fuel / orm

Fuel PHP Framework - Fuel v1.x ORM
http://fuelphp.com/docs/packages/orm/intro.html
151 stars 95 forks source link

Support for custom names of PK column #382

Closed ppatrik closed 9 years ago

ppatrik commented 9 years ago

tables should have other PK names than 'id', eg. 'table_id'

mikepmtl commented 9 years ago

It already is supported.

protected static $_primary_key = array('aid');

http://fuelphp.com/docs/packages/orm/creating_models.html

ppatrik commented 9 years ago

yes but here in temporal model it was written to only accept id see

classes/model/temporal.php line 153

        $query = static::query()
            ->where('id', $id)    <------- this is not correct
            ->where($timestamp_start_name, '<=', $timestamp)
            ->where($timestamp_end_name, '>', $timestamp);
WanWizard commented 9 years ago

You'll have to wait until @stevewest gets back, to asses it.

I'm pretty sure this has something to do with the complexities of compound PK's, something your PR doesn't address either.

emlynwest commented 9 years ago

Temporal is limited to "id" by design. It's a current limitation of the v1 temporal model and will be addressed in v2.