Skip to content

Instantly share code, notes, and snippets.

@kiote
Created November 10, 2011 09:40
Show Gist options
  • Save kiote/1354506 to your computer and use it in GitHub Desktop.
Save kiote/1354506 to your computer and use it in GitHub Desktop.
/// было
$select = $table->select()
->where('parent_id = ?', $this->_post->getId())
->order('time');
$repliesXml = '';
foreach ($select->fetchAll() as $item) {
$repliesXml .= $item->getFullXml();
}
/// стало
$table = new Message_Post();
$mapper = $table->getMapper();
$replies = $mapper->withParent($this->_post->getId())->fetchAll();
$repliesXml = '';
foreach ($replies as $item) {
$repliesXml .= $item->getFullXml();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment