jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

Small Bug in Jelly_Collection_Core->as_array() #24

Closed raeldc closed 14 years ago

raeldc commented 14 years ago

I just found this out when I using as_array in Jelly Collections.

Line 43 is currently:

$meta = Jelly::meta($model);

Which will return undefined variable $model. It should be like this:

public function as_array($key = NULL, $value = NULL)
{
    if ($this->_model)
    {
        $meta = Jelly::meta($this->_model);

        foreach (array('key', 'value') as $var)
        {
            if ($field = $meta->fields($$var))
            {
                $$var = $field->column;
            }
        }
    }

    return $this->_result->as_array($key, $value);
}
jonathangeiger commented 14 years ago

Closed by 8df4233cc1759133fea9466762d6a10e2b3b26a4. Thanks raeldc!