protected function get_total_post_count() { if(!isset($this->total_post_count)) { global $container; $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']); $this->total_post_count = $repository->getActivePostsCount(); } return $this->total_post_count; }