final private function get_tags_for_post($post) { global $container; $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); $tag_result = $repository->getTagsForPost($post['id']); $tag_array = array(); foreach($tag_result as $tag) { $tag_object = new stdclass(); $tag_object->name = $tag['tag']; $tag_object->link = Content::instance('URLSafe', "/tag/{$tag['tag']}/")->activate(); $tag_array[] = $tag_object; } return $tag_array; }
public function __construct() { parent::__construct(); global $container; $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); $this->post = $repository->findPostByPath(URLDecode::getPiece(2)); if($this->post == null) $this->eject(); $this->handle_comment_submit( self::$BLOG_SITE_ID, $this->post['path'], Loader::getRootUrl('blog') . $this->post['category'] . '/' . $this->post['path'] . '/', $this->post['title']); global $container; $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']); $this->tags = $repository->getTagsForPost($this->post['id']); }