implement TwingleShop integration
This commit is contained in:
parent
ea46e6a747
commit
8cfa270dff
60 changed files with 5200 additions and 106 deletions
10
xml/schema/CRM/Twingle/TwingleProduct.entityType.php
Normal file
10
xml/schema/CRM/Twingle/TwingleProduct.entityType.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
// This file declares a new entity type. For more details, see "hook_civicrm_entityTypes" at:
|
||||
// https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
|
||||
return [
|
||||
[
|
||||
'name' => 'TwingleProduct',
|
||||
'class' => 'Civi\Twingle\Shop\DAO\TwingleProduct',
|
||||
'table' => 'civicrm_twingle_product',
|
||||
],
|
||||
];
|
75
xml/schema/CRM/Twingle/TwingleProduct.xml
Normal file
75
xml/schema/CRM/Twingle/TwingleProduct.xml
Normal file
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||
|
||||
<table>
|
||||
<base>CRM/Twingle/Shop</base>
|
||||
<class>TwingleProduct</class>
|
||||
<name>civicrm_twingle_product</name>
|
||||
<comment>This table contains the Twingle Product data.</comment>
|
||||
<log>false</log>
|
||||
<!-- <add>1.5</add>-->
|
||||
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>int unsigned</type>
|
||||
<required>true</required>
|
||||
<unique>true</unique>
|
||||
<comment>Unique TwingleProduct ID</comment>
|
||||
<html>
|
||||
<type>Number</type>
|
||||
</html>
|
||||
</field>
|
||||
<primaryKey>
|
||||
<name>id</name>
|
||||
<autoincrement>true</autoincrement>
|
||||
</primaryKey>
|
||||
|
||||
<field>
|
||||
<name>external_id</name>
|
||||
<type>int unsigned</type>
|
||||
<required>true</required>
|
||||
<comment>The ID of this product in the Twingle database</comment>
|
||||
<html>
|
||||
<type>Number</type>
|
||||
</html>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>price_field_id</name>
|
||||
<type>int unsigned</type>
|
||||
<comment>FK to Price Field</comment>
|
||||
<required>true</required>
|
||||
</field>
|
||||
<foreignKey>
|
||||
<name>price_field_id</name>
|
||||
<table>civicrm_contact</table>
|
||||
<key>id</key>
|
||||
<onDelete>CASCADE</onDelete>
|
||||
</foreignKey>
|
||||
|
||||
<field>
|
||||
<name>twingle_shop_id</name>
|
||||
<type>int unsigned</type>
|
||||
<unique>true</unique>
|
||||
<comment>FK to Twingle Shop</comment>
|
||||
</field>
|
||||
<foreignKey>
|
||||
<name>twingle_shop_id</name>
|
||||
<table>civicrm_twingle_shop</table>
|
||||
<key>id</key>
|
||||
<onDelete>CASCADE</onDelete>
|
||||
</foreignKey>
|
||||
|
||||
<field>
|
||||
<name>created_at</name>
|
||||
<type>datetime</type>
|
||||
<required>true</required>
|
||||
<comment>Timestamp of when the product was created in the database</comment>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>updated_at</name>
|
||||
<type>datetime</type>
|
||||
<required>true</required>
|
||||
<comment>Timestamp of when the product was last updated in the database</comment>
|
||||
</field>
|
||||
</table>
|
10
xml/schema/CRM/Twingle/TwingleShop.entityType.php
Normal file
10
xml/schema/CRM/Twingle/TwingleShop.entityType.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
// This file declares a new entity type. For more details, see "hook_civicrm_entityTypes" at:
|
||||
// https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes
|
||||
return [
|
||||
[
|
||||
'name' => 'TwingleShop',
|
||||
'class' => 'Civi\Twingle\Shop\DAO\TwingleShop',
|
||||
'table' => 'civicrm_twingle_shop',
|
||||
],
|
||||
];
|
73
xml/schema/CRM/Twingle/TwingleShop.xml
Normal file
73
xml/schema/CRM/Twingle/TwingleShop.xml
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||
|
||||
<table>
|
||||
<base>CRM/Twingle/Shop</base>
|
||||
<class>TwingleShop</class>
|
||||
<name>civicrm_twingle_shop</name>
|
||||
<comment>This table contains the Twingle Shop data. Each Twingle Shop is linked to a corresponding Price Set.</comment>
|
||||
<log>false</log>
|
||||
<!-- <add>1.5</add>-->
|
||||
|
||||
<field>
|
||||
<name>id</name>
|
||||
<type>int unsigned</type>
|
||||
<required>true</required>
|
||||
<unique>true</unique>
|
||||
<comment>Unique TwingleShop ID</comment>
|
||||
<html>
|
||||
<type>Number</type>
|
||||
</html>
|
||||
</field>
|
||||
<primaryKey>
|
||||
<name>id</name>
|
||||
<autoincrement>true</autoincrement>
|
||||
</primaryKey>
|
||||
|
||||
<field>
|
||||
<name>project_identifier</name>
|
||||
<type>varchar</type>
|
||||
<length>32</length>
|
||||
<required>true</required>
|
||||
<unique>true</unique>
|
||||
<comment>Twingle Project Identifier</comment>
|
||||
<html>
|
||||
<type>Text</type>
|
||||
</html>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>numerical_project_id</name>
|
||||
<type>int unsigned</type>
|
||||
<required>true</required>
|
||||
<unique>true</unique>
|
||||
<comment>Numerical Twingle Project Identifier</comment>
|
||||
<html>
|
||||
<type>Number</type>
|
||||
</html>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>price_set_id</name>
|
||||
<type>int unsigned</type>
|
||||
<unique>true</unique>
|
||||
<comment>FK to Price Set</comment>
|
||||
</field>
|
||||
<foreignKey>
|
||||
<name>price_set_id</name>
|
||||
<table>civicrm_price_set</table>
|
||||
<key>id</key>
|
||||
<onDelete>CASCADE</onDelete>
|
||||
</foreignKey>
|
||||
|
||||
<field>
|
||||
<name>name</name>
|
||||
<type>varchar</type>
|
||||
<unique>false</unique>
|
||||
<length>64</length>
|
||||
<required>true</required>
|
||||
<comment>name of the shop</comment>
|
||||
<html>
|
||||
<type>Text</type>
|
||||
</html>
|
||||
</field>
|
||||
</table>
|
Loading…
Add table
Add a link
Reference in a new issue