3

As I am new to CiviCRM. I am trying to create a new entity for my extension to add some new data in database schema. The documentation I am following to create a new entity is: https://docs.civicrm.org/dev/en/master/extensions/civix/#generate-entity

What I have done using the documentation till Now:

  • I have created successfully new extension under the folder <drupalroot>/sites/.../civicrm/ext/
  • The extension is enabled from the CiviCRM » Administer » System Settings » Extensions
  • I have used civix generate:entity MyEntity to generate a new entity.
  • The entity is generated under the ext/myextension/.
  • This command has created seketal files successfully.
  • I have edited the xml file to add fields for entity (table).
  • Now, 1 - 3 points are done.

I have got stucked when following the point 4 - end. The overflow and files and folder structure is defined in these point and how to generate or run the DAO file to run sql to create new table in database schema looks weird to me. I am using Drupal v7, Civicrm v4.7.2 for drupal 7.x and XAMPP on Windows OS envirnoment. I don't now what I have to do after it to successfully create and use entity in my CiviCRM extension.

Please help me to solve this problem. I am very thankful to you in advance.

Best Regards.

1 Answer 1

1

You need to install civicrm using buildkit to ensure you have all the dependencies / tools / files. Then have a look here: https://docs.civicrm.org/dev/en/master/extensions/civix/

Examples of extensions that have done it (see ./bin/setup.sh for a scripted method of DAO creation): https://github.com/civicrm/org.civicrm.volunteer And https://github.com/3sd/civicrm-sms-conversations/

1
  • Thank you. I have to try buildkit and then response you back.
    – Syed Aqeel
    Jun 22, 2017 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.