Hello! Such a question, let's say you need to do simple operations with the tables of tables, it’s not necessary to create a model class Model_Table extends ORM {} if I can immediately apply $ tables = ORM :: factory ('table') -> find_all (); or is it not good?

  • one
    Immediately you can not apply, you need to describe the ORM Model. And without ORM it is possible through DB :: query (Database :: SELECT, 'SELECT * FROM table'); - Vfvtnjd
  • OK thanks! I just created the model first, and then deleted it, but the appeal to the table still worked for some reason) The project was closed - opened again and did not work anymore, it knocked me down and I thought that it was possible to apply this way. Is it possible to register all the tables in one model in order not to create several models? - noob_pro

1 answer 1

According to the logic of Kokhany : 1 model ~ 1 table. If through ORM you want to describe all the models in one file, you first need to describe it as a class (в папке application/classess) . And then Expendit from it, well, this is a matter of taste.

!!! But I advise you not to be lazy and для каждого моделя ОРМ создать свои модели-классы , believe it for the better. Save mega time , with further development.

  • >> "According to the logic of Kokhany: 1 model ~ 1 table." << - I have no more questions! Thank! - noob_pro