Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 220 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP: ORM framework or library that I can use with my database table structure

#1
I was using KohanaPHP ORM but I can't use it with my database table structure. So, I need a framework or library ORM to use with it.

With Kohana I need to follow a naming convention. I can't use a field name (foreign key) like 'idUnidadeMedida'.

Are there any suggestions?

Thank you.

---

<?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';
}
?>
Reply

#2
Doctrine is PHP's most powerful ORM (and database abstraction layer) - there's not much it can't do. V2 (soon to be released) may well become the de-facto standard, and will see integration with frameworks (i.e. Zend, although it's easily used stand-alone too).

- [Doctrine 2 Preview release][1]
- [Slideshare presentation][2]
- [Wiki Overview][3]


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#3
Actually, Kohana ORM isn't that limited. In case of Ko3's ORM, you can define everything concerning your relationships as I explained here;

[To see links please register here]


( look at the code, not explanation, since that guy asked for varchar FKs )
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through