How do I make a returned ORM result object in Kohana suitable for use in the items parameter of the RSS feed helper?
For example, if want to add all of my user posts to the feed.
$posts = ORM::factory('posts')->find_all();
The items parameter used in feed::create()
needs to be a multidimensional array. Is there a simple way to format the returned object as a multidimensional array in correct format?
Here's what I've got so far:
$items = array();
$info = array( 'title' => 'test feed' );
$posts = ORM::factory('post')->find_all();
foreach ($posts as $post)
{
$item = array('title' => $post->title,
'summary' => $post->description,
'pubDate' => $post->date);
$items[] = $item;
}
$this->request->response = Feed::create($info, $items);