86.
87.
88. public function download(Int $id = 0)
89. {
90.
91. $post_attachment = DB::where('int:id', $id)->get('post_attachment')->row();
92.
93. $post = Model\Post::row($post_attachment->post_id);
94. if (empty($post)) {
95. redirect(URL::site(404));
96. }
97. $access = Model\Post::accessPost($post->category_id);
98. if($access)
99. {
100. redirect('access-denied');
101. }
102.
103. /*
104. if (empty($post_attachment)) {
105. throw new Pati_Exception_PageNotFound();