Welcome Guest, Not a member yet? Register   Sign In
Model Design Question
#8

Mike I think I get what you are trying to do, and I'm also not sure why it isn't working. First off though I would recommend making these classes in the Entities folder for framework consistency. You can do whatever you want of course, but in Model-View-Controller the model handles loading data from the database (you're using the Builder class instead, which is fine) and then the returned results are Entities (which can be arrays, generic objects, or a custom object class like yours). Just a suggestion.
CustomResultObject should be setting a value for each field returned in the result set:
PHP Code:
foreach ($this->{$_data}[$i] as $key => $value)
{
    
$this->customResultObject[$className][$i]->$key $value;


So first thing I'd check is that your result actually has the data. Something like:
PHP Code:
var_dump($db1->get()->getResultArray()); 
Reply


Messages In This Thread
Model Design Question - by IVIike - 12-11-2019, 06:16 AM
RE: Model Design Question - by vincent78 - 12-11-2019, 11:37 AM
RE: Model Design Question - by IVIike - 12-13-2019, 03:06 AM
RE: Model Design Question - by MGatner - 12-13-2019, 03:59 PM
RE: Model Design Question - by vincent78 - 12-13-2019, 04:47 PM
RE: Model Design Question - by MGatner - 12-14-2019, 05:34 AM
RE: Model Design Question - by IVIike - 12-16-2019, 12:40 AM
RE: Model Design Question - by MGatner - 12-20-2019, 07:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB