I used KohanaPHP ORH, but I cannot use it with my database table structure. So, I need an infrastructure or ORM library to use with it.
With Kohana, I need to follow a naming convention. I cannot use the field name (foreign key), for example 'idUnidadeMedida'.
Are there any suggestions?
Thanks.
<?php class Model_Produto extends ORM { protected $_table_name = 'produtos'; protected $_primary_key = 'pro_codigo'; protected $_has_one = array('unidade' => array('model' => 'unidade', 'foreign_key' => 'uni_codigo')); } ?> <?php class Model_Unidade extends ORM { protected $_table_name = 'unidades'; protected $_primary_key = 'uni_codigo'; } ?>
source share