Hi I have two Modules on each modules i have models with table class, I want to referenceMap two table class one in each module.
This is what I have:
This one is in Invoice Module.
class Invoice_Resource_InvoiceByProgress extends SA_Model_Resource_Db_Table_Abstract
implements Invoice_Resource_InvoiceByProgress_Interface
{
protected $_name = 'invoice_by_progress';
protected $_primary = array('invoice_by_progressId');
protected $_rowClass = 'Invoice_Resource_InvoiceByProgress_Item';
protected $_referenceMap = array(
'Project2client' => array(
'columns' => 'project2clientId',
'refTableClass' => 'Siteanalysis_Resource_Project2client',
'refColumns' => 'project2clientId',
'onDelete' => self::CASCADE
),
);
And this one is in Siteanalysis Module.
class Siteanalysis_Resource_Project2client extends SA_Model_Resource_Db_Table_Abstract
implements Siteanalysis_Resource_Project2client_Interface
{
protected $_name = 'project2client';
protected $_primary = 'project2clientId';
protected $_rowClass = 'Siteanalysis_Resource_Project2client_Item';
protected $_dependentTables = array('Invoice_Resource_InvoiceByProgress');
protected $_referenceMap = array(
'Project' => array(
'columns' => 'projectId',
'refTableClass' => 'Siteanalysis_Resource_Project',
'refColumns' => 'projectId',
'onDelete' => self::CASCADE
),);
My question is how can i make $_referenceMap to work?
Thanks in advance.
The problem was that
protected $_dependentTables = array(‘Invoice_Resource_InvoiceByProgress’);
has to be
protected $_dependentTables = array(‘Invoice_Resource_Invoicebyprogress’);
instead of the class name the file name.