Open marcalj opened 13 years ago
Your method don't returned unmapped to db fields, get() do this.
Fixed version:
public function get_raw($name)
{
if ($field = $this->_meta->field($name))
{
// Alias the name to its actual name
$name = $field->name;
if (array_key_exists($name, $this->_changed))
{
return $this->_changed[$name];
}
else
{
return $this->_original[$name];
}
}
// Return unmapped data from custom queries
elseif (isset($this->_unmapped[$name]))
{
return $this->_unmapped[$name];
}
}
What do you mean with "unmapped".
Sorry but I don't use any ORM in my projects, just Model_Database amb DB class. I need more low level tunning.
unmapped fields on't have column in table in db
Ups, ok got it! ;)
Hi, when finetunning one application I saw that Jelly_Model->as_array(), on relationships load all items in the database. I was using it as a way to get "raw" data of a model.
So I implement a workaround:
So basically for Jelly_Field_HasMany and Jelly_Field_ManyToMany do not call "get" method, and for Jelly_Field_HasOne and Jelly_Field_BelongsTo I'm using the "get_raw" custom function.
Happy tunning :)