UPDATE: Found the problem… The controllers name was the same as the models… Problem fixed now.
Im having an issue with the get function
Error Message:
[20-Jan-2009 14:35:03] PHP Fatal error: Call to undefined method Brainstorm::get() in /home/fourtwo1/public_html/dirt/application/controllers/brainstorm.php on line 18Controller
class Brainstorm extends Controller {
function Brainstorm()
{
parent::Controller();
}
function index()
{
}
function grid()
{
$b = New Brainstorm();
$b->get();
//$b->user->get();
//$b->data_source->get();
//$b->issue_type->get();
//$b->status->get();
// $b->priority->get();
foreach ($b->all as $bstorm)
{
echo pre_print_r($bstorm);
}
}
}
/* End of file brainstorm.php */
/* Location: ./system/application/controllers/brainstorm.php */Model
<?php
/**
* Brainstorm Class
*
* Transforms users table into an object.
* This is just here for use with the example in the Controllers.
*
* @licence MIT Licence
* @category Models
* @author Simon Stenhouse
* @link <a href="http://stensi.com">http://stensi.com</a>
*/
class Brainstorm extends DataMapper
{
var $table = 'brainstorms';
//var $has_one = array("user", "status", "priority", "issue_type");
//var $has_many = array("data_source");
var $validation = array(
array(
'field' => 'title',
'label' => 'Title',
'rules' => array('trim', 'unique', 'min_length' => 2, 'max_length' => 255, 'alpha_dash')
),
array(
'field' => 'description',
'label' => 'Description',
'rules' => array('trim', 'alpha_dash')
),
array(
'field' => 'orgin_date',
'label' => 'Orgin Date',
'rules' => array('required', 'trim', 'is_natural')
),
array(
'field' => 'estimated_count_total',
'label' => 'Estimated Count Total',
'rules' => array('trim', 'is_natural')
),
array(
'field' => 'estimated_count_total',
'label' => 'Estimated Count Manual',
'rules' => array('trim', 'is_natural')
)
);
/**
* Constructor
*
* Initialize DataMapper.
*/
function Brainstorm()
{
parent::DataMapper();
}
// --------------------------------------------------------------------
}
/* End of file brainstorm.php */
/* Location: ./application/models/brainstorm.php */datamapper is being autoloaded