Quote:
Originally Posted by Ed B.
Is it possible to create a new table in XC database?
|
Absolutely. This is done by adding a Model into your Module.
Make a file in your module:
XLite\Module\YourDevID\YourModuleName\Model\Table. php
Code:
namespace XLite\Module\YourDevID\YourModuleName\Model;
/**
* @Entity
* @Table (name="devid_some_table")
*/
class Table extends \XLite\Model\AEntity
{
/**
* @Id
* @GeneratedValue (strategy="AUTO")
* @Column (type="integer", options={ "unsigned": true })
*/
protected $id;
/**
* @Column (type="boolean")
*/
protected $enabled = true;
/**
* @Column (type="string", length=1024)
*/
protected $text = '';
}
Of course you can rename the Table.php class to reflect something more relevant to your cause, and change the field names to your liking.
This file above should create a table called "devid_some_table", which you can see in the comments and can change to your liking.