Answer the question
In order to leave comments, you need to log in
How to create a D7 entity?
I do everything as described here: https://dev.1c-bitrix.ru/learning/course/index.php...
But when I try to use the class, I get Class not found.
I read this topic - https://dev.1c-bitrix.ru/support/forum/forum6/topi...
I did not understand the following - why should I connect the module if the lesson clearly says:
It remains only to fix the entity code in the project. According to the general rules for naming files in D7, the entity code must be saved in the file: local/modules/somepartner.mybookscatalog/lib/book.php
After that, the system will automatically include the file when it finds calls to the BookTable class.
Answer the question
In order to leave comments, you need to log in
Entity D7 is a regular class. In order for everything to work, you need to connect this class.
If the class is outside the module, then through autoload or the usual include (or require).
You seem to have a module. In order for everything to work, the module must have at least the required files and be installed through the system menu. It is installed , and not just copied to the modules folder.
Next, the class that describes your table in the database must be placed in the lib folder of the module. The file name must be in lowercase and must not contain the word Table.
For example, for the BooksTable class, the file name should be books.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question