[eluser]tarciozemel[/eluser]
For those wich use the amazing DataMapper, can you use include_related() with all_to_array()? I'm trying to do this, but the all_to_array() only provides an empty array...
Code:
$empresas = new Empresa_model();
$empresas->where_related('cidade/uf', $uf)
->include_related('cidade', array('nome'))
->limit(1)
->get();
$array = array
(
'nome',
'slug',
'cidade'
);
return $empresas->all_to_array($array);
When I do
print_r($empresas->all_to_array($array)), I get:
Code:
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: datamapper/array.php
Line Number: 57
Array
(
[0] => Array
(
[nome] => Foo
[slug] => foo
[cidade] => Array
(
)
)
)
Can you help me? :-)