예제 #1
0
 public function scopeUpdateOffenderCategory()
 {
     $wp_posts = array(array('name' => 'Sexual Assault', 'slug' => 'sexual-assault', 'police_offender_id' => '14'), array('name' => 'Shooting Unarmed', 'slug' => 'shooting-unarmed', 'police_offender_id' => '23'), array('name' => 'Inhuman treatment', 'slug' => 'inhuman-treatment', 'police_offender_id' => '24'), array('name' => 'Inhuman treatment', 'slug' => 'inhuman-treatment', 'police_offender_id' => '25'), array('name' => 'Brutality', 'slug' => 'brutality', 'police_offender_id' => '28'), array('name' => 'Excessive Force', 'slug' => 'excessive-force', 'police_offender_id' => '29'), array('name' => 'Animal Cruelty', 'slug' => 'animal-cruelty', 'police_offender_id' => '30'), array('name' => 'Shooting Unarmed', 'slug' => 'shooting-unarmed', 'police_offender_id' => '31'), array('name' => 'Sexual Deviance', 'slug' => 'sexual-deviance', 'police_offender_id' => '32'), array('name' => 'Sexual Deviance', 'slug' => 'sexual-deviance', 'police_offender_id' => '33'), array('name' => 'Sexual Assault', 'slug' => 'sexual-assault', 'police_offender_id' => '34'), array('name' => 'Sexual Assault', 'slug' => 'sexual-assault', 'police_offender_id' => '35'), array('name' => 'Brutality', 'slug' => 'brutality', 'police_offender_id' => '36'), array('name' => 'Sexual Assault', 'slug' => 'sexual-assault', 'police_offender_id' => '37'), array('name' => 'Brutality', 'slug' => 'brutality', 'police_offender_id' => '38'), array('name' => 'Aggravated Sexual Assault', 'slug' => 'aggravated-sexual-assault', 'police_offender_id' => '39'), array('name' => 'Aggravated Sexual Assault', 'slug' => 'aggravated-sexual-assault', 'police_offender_id' => '40'), array('name' => 'Excessive Force', 'slug' => 'excessive-force', 'police_offender_id' => '41'), array('name' => 'Illegal Search', 'slug' => 'illegal-search', 'police_offender_id' => '42'), array('name' => 'Illegal Search', 'slug' => 'illegal-search', 'police_offender_id' => '43'), array('name' => 'Sexual Assault', 'slug' => 'sexual-assault', 'police_offender_id' => '44'), array('name' => 'Body Cam Tampering', 'slug' => 'body-cam-tampering', 'police_offender_id' => '45'), array('name' => 'Brutality of Handcuffed', 'slug' => 'brutality-arrested', 'police_offender_id' => '46'), array('name' => 'Sexual Deviance', 'slug' => 'sexual-deviance', 'police_offender_id' => '47'), array('name' => 'Excessive Force', 'slug' => 'excessive-force', 'police_offender_id' => '48'), array('name' => 'Brutality Leading to Death', 'slug' => 'brutality-fatal', 'police_offender_id' => '49'), array('name' => 'Shooting Unarmed', 'slug' => 'shooting-unarmed', 'police_offender_id' => '50'), array('name' => 'Shooting Dogs', 'slug' => 'shooting-dogs', 'police_offender_id' => '51'), array('name' => 'unarmed-shooting', 'slug' => 'unarmed-shooting', 'police_offender_id' => '52'));
     foreach ($wp_posts as $p) {
         $off = Offender::find($p['police_offender_id']);
         $off->offender_category = $p['slug'];
         $off->save();
     }
 }
예제 #2
0
 public function getIndex()
 {
     $posts = Post::getPosts(array('limit' => 1));
     if (is_array($posts)) {
         for ($x = 0; $x < count($posts); $x++) {
             $posts[$x]->post_tags = implode(', ', $this->linkTagByPostId($posts[$x]->post_id));
         }
     }
     $tagCloud = Post::getTagCloud();
     $offenders = Offender::getOffenders();
     return View::make('home', array('posts' => $posts, 'tagCloud' => $tagCloud, 'offenders' => $offenders));
 }
예제 #3
0
 public function getOffendersByCategory($id)
 {
     $offender = Offender::getOffender($id);
     return View::make('offender', array('offender' => (object) $offender));
 }