PHP: ORM structure or library that I can use with my database table structure

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'; } ?> 
+4
source share
2 answers

Actually, Kohana ORM is not limited. In the case of OR3 Ko3, you can define everything that relates to your relationship, as I explained here;

How to link tables with different foreign key names in Kohana ORH?

(look at the code, not the explanation, as this guy asked for Vakhchar FK)

+2
source

Doctrine is the most powerful PHP ORM (and database abstraction layer) - there is little that it can do. V2 (will be released soon) may well become the de facto standard and will see integration with frameworks (i.e. Zend, although it is also easily used autonomously).

+1
source

Source: https://habr.com/ru/post/1309998/


All Articles