chozma
Member
Hi all,
I have something unexpected going on and need some help figuring out why...
I have a list called 'animal' which is joined to another list called 'mob-animal'. 'Mob-animal' has a database join element called 'mob' which stores the mob id (an integer) from another table called 'mob' as the value and the name (a string) as the label. This all works as it should.
However, in my animals details template I want to get the id number of the mob associated with the animal which I thought be should be easy enough. I'm accessing the elements like this:
But if I do a var_dump of $mobElements I can see that for the entry named 'mob' it doesn't let me get the id number (the value actually stored in the database), only the label. Excerpt of the var_dump relating to the mob element below.
Is this right? Shouldn't I be able to access the id number as this is the actual value being stored in the database and that's what I can see in phpmyadmin? How can I access the value stored in the database?
Thanks as always, I feel quite puzzled by this one!!
I have something unexpected going on and need some help figuring out why...
I have a list called 'animal' which is joined to another list called 'mob-animal'. 'Mob-animal' has a database join element called 'mob' which stores the mob id (an integer) from another table called 'mob' as the value and the name (a string) as the label. This all works as it should.
However, in my animals details template I want to get the id number of the mob associated with the animal which I thought be should be easy enough. I'm accessing the elements like this:
Code:
$myMob = $this->groups['Animal- [app_mob_animal]'];
$mobElements = $myMob->elements;
But if I do a var_dump of $mobElements I can see that for the entry named 'mob' it doesn't let me get the id number (the value actually stored in the database), only the label. Excerpt of the var_dump relating to the mob element below.
Is this right? Shouldn't I be able to access the id number as this is the actual value being stored in the database and that's what I can see in phpmyadmin? How can I access the value stored in the database?
Thanks as always, I feel quite puzzled by this one!!
Code:
["mob"]=>
object(stdClass)#932 (23) {
["startRow"]=>
bool(true)
["endRow"]=>
int(1)
["error"]=>
string(0) ""
["plugin"]=>
string(12) "databasejoin"
["hidden"]=>
bool(false)
["id"]=>
string(25) "app_mob_animal___mob_ro_0"
["className"]=>
string(31) "fb_el_app_mob_animal___mob_ro_0"
["containerClass"]=>
string(126) "fabrikElementContainer plg-databasejoin fb_el_app_mob_animal___mob_ro_0 fabrikRepeatGroup___app_mob_animal___mob mode-dropdown"
["element"]=>
string(103) "Llama Dance Troop"
["label_raw"]=>
string(3) "Mob"
["label"]=>
string(85) "
Mob"
["errorTag"]=>
string(40) "
"
["element_ro"]=>
string(61) "Llama Dance Troop"
["value"]=>
array(1) {
[0]=>
string(17) "Llama Dance Troop"
}
["element_raw"]=>
array(1) {
[0]=>
string(17) "Llama Dance Troop"
}
["labels"]=>
string(1) "0"
["dlabels"]=>
string(1) "0"
["tipAbove"]=>
string(0) ""
["tipBelow"]=>
string(0) ""
["tipSide"]=>
string(0) ""
["offset"]=>
int(0)
["span"]=>
string(7) " span12"
["column"]=>
string(31) " style="clear:both;width:100%;""
}