[eluser]sheldonnbbaker[/eluser]
This looks great - just started out a few days ago.
I still haven't been able to do anything with it as I'm not getting the results I expected.
I have a widgets table (contains widgets), a widget_versions table (contains versions of widgets, e.g., 1.0.0, 2.1.5, etc.) with fields id, widget_id, and a ratings_widget_versions table with fields widget_version_id and rating_id.
My controller:
Code:
$widgets = new Widget();
$widgets->get()->widget_version->get();
$this->load->view('', array('widgets' => $widgets));
models/widget.php:
Code:
<?php class Widget extends DataMapper {
var $has_one = array();
var $has_many = array('widget_version');
function __construct($id = NULL)
{
parent::__construct($id);
}
}
models/widget_version.php:
Code:
<?php class Widget_version extends DataMapper {
var $has_one = array('widget');
var $has_many = array('rating');
function __construct($id = NULL)
{
parent::__construct($id);
}
}
models/rating.php:
Code:
<?php class Rating extends DataMapper {
var $has_one = array();
var $has_many = array('workflow_version');
function __construct($id = NULL)
{
parent::__construct($id);
}
}