CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • civix generate:table does not work
Pages: [1]

Author Topic: civix generate:table does not work  (Read 967 times)

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
civix generate:table does not work
July 10, 2013, 04:52:38 am
Hey,

The civix command civix generate:table as discussed on the post by totten on http://wiki.civicrm.org/confluence/display/CRM/CiviCRM+Database+Layer+for+Extensions does not work. That command does not exist in my civix, which I just updated to the latest version.

Does anyone know why this command isn't working anymore?

Thanks,
Jaap
Developer at Edeveloper / CiviCoop

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: civix generate:table does not work
July 10, 2013, 10:02:36 am
Hello, Jaap,

That page doesn't seem to communicate some important context -- the page was discussing designs/ideas/proposals and not actual implementations. I've added a note at the top about that.

With that said, there has been some recent/bleeding-edge progress on this front, but the implementation is still incomplete & experimental. If using the latest/developmental versions of civix and CiviCRM (from git), then one can use "civix generate:entity" to create some skeletal files:

 * xml/schema/CRM/Myextension/MyEntity.xml
 * CRM/Myextension/BAO/MyEntity.php
 * api/v3/MyEntity.php

However, there are several bits that it doesn't setup automatically -- for CiviHR and CiviVolunteer, we've written these parts manually:

 * Add hook_civicrm_entityTypes (eg this code is in CiviHR: https://github.com/civicrm/civihr/blob/master/hrjob/hrjob.php#L90 )
 * Generate DAOs (eg in CiviHR, we have these files: https://github.com/civicrm/civihr/blob/master/hrjob/bin/setup.sh , https://github.com/civicrm/civihr/blob/master/hrjob/xml/schema/Schema.xml.inc , and https://github.com/civicrm/civihr/blob/master/hrjob/xml/schema/CRM/HRJob/files.xml)
 * Generate SQL (eg in CiviHR, we run setup.sh above and then manually copy/paste .sql from civicrm/sql/civicrm.mysql to https://github.com/civicrm/civihr/blob/master/hrjob/sql/auto_install.sql )

It would be great if we could update civix to handle these parts, too, but I don't think I'll have time for that in July. (Patches/collaborations would be quite welcome, though. ;) )

jaapjansma

  • I post frequently
  • ***
  • Posts: 247
  • Karma: 9
    • CiviCoop
  • CiviCRM version: 4.4.2
  • CMS version: Drupal 7
  • MySQL version: 5
  • PHP version: 5.4
Re: civix generate:table does not work
July 11, 2013, 12:17:55 am
Hey Tim,

Where does the dev version of civix store those files? In my exteniosn directory or in the core directory?
As I understand correctly generating entities in an extension is still in a design/development stage?

Thanks anyway for your quick reply

Jaap
Developer at Edeveloper / CiviCoop

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: civix generate:table does not work
July 11, 2013, 06:55:27 am
Hi,

once generated, the bao/dao will work directy from the extension.
For sepa, we do create a symlink from the core civi to our xml, run GenCode.php and copy back manually the sql+DAO

Works ok and what Tim is working on seems to avoid most of the manual work, but it's still in the "you need to look at the code and know how it would be done manually" stage, I presume.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • civix generate:table does not work

This forum was archived on 2017-11-26.