[eluser]grisha[/eluser]
Hello there. Today I've tried to implement DM 1.7.1 into one of my projects. Following the guide provided by DM developer I've encountered a problem.
The Contractor Creation method is like this:
Code:
$c = new CContractor();
$c->company_name = $this->input->post('company_name');
// ...
$c->comment = $this->input->post('comment');
// Store the contractor
$c->save();
// Relate him with the current customer
$this->customer->save($c);
The
field is a member of MY_Controller and set up during the MY_Controller::__construct() with a valid Customer class object.
The contractor is being added properly to the database. Just before the call of
Code:
$this->customer->save($c)
I've checked the ID's of both $this->customer and $c - and they are both valid integers - so that means that objects are valid.
I'm not sure if it isn't a bug or smth. In the end I've got:
Code:
Unable to relate customer with ccontractor.
Am I doing something wrong?