@Mark, thanks! But anyway sorry for my stupid questions ... There are some cases when these functions are really great. Anyway I am having trouble with a simple query about getting comments for a specific post. I mean ... I can get them really easy with your functions, like:
function get_comments($id)<br />
{<br />
$comments = $this->with('comments')->get(<br />
array(<br />
'post' => $id,<br />
'fields' => array('author', 'comment', 'added')<br />
)<br />
);</p>
<p> if ( ! $comments)<br />
{<br />
return array();<br />
}<br />
else<br />
{<br />
return $comments;<br />
}<br />
}
But what is the problem here ... I have everything really raw. For example this gives me for “added” datestamp, which I really want to transform in something nicer like “2 days ago”. I mean, this way for doing things is really quick, gentle. But in this case, I am getting everything ready in an array and I can not do something like:
$added = nice_time($row[‘added’]);
So I have to use a regular query, because I don’t think I can do something with your set of functions. Like:
$query = $this->db->select(‘id’, ‘author’, ‘comment’, ‘added’)->from(‘comments’)<br />
->order_by(‘id’, ‘desc’)<br />
->limit($limit, $offset)<br />
->get();<br />
foreach ($query->result_array() as $row)<br />
{<br />
$comments[] = array(<br />
'added' => nice_time($row['added']),<br />
...<br />
);<br />
}<br />
return $comments;
Which will work, but anyway how can I have the same result, using your functions and having smaller code as a result?
:(