23 lines
No EOL
638 B
PHP
23 lines
No EOL
638 B
PHP
<?php
|
|
|
|
class Mapper_Tag extends Fiktiv_Model_Mapper_DbTableAbstract
|
|
{
|
|
public function findByBlogPost($id)
|
|
{
|
|
|
|
$postHasTagsTable = new Table_PosthasTag();
|
|
|
|
$rows = $postHasTagsTable->getAdapter()->select()
|
|
->from('Post_has_Tag',array())
|
|
->join('Tag', 'Tag.id = Post_has_Tag.tagId', array('id', 'name'))
|
|
->where('Post_has_Tag.postId = ?', $id)
|
|
->query()->fetchAll();
|
|
|
|
$tags = array();
|
|
foreach ($rows as $row) {
|
|
$tags[$row['id']] = $row['name'];
|
|
}
|
|
|
|
return $tags;
|
|
}
|
|
} |