public static function delete()
 {
     $post = Information::load(Request::post("id"));
     if (!$post) {
         return;
     }
     $post->delete();
 }
Exemple #2
0
 public static function all()
 {
     if (!file_exists(DATA_DIR)) {
         return array();
     }
     $information = array();
     foreach (scandir(DATA_DIR, 1) as $fname) {
         if (preg_match("/^[0-9]+\$/", $fname)) {
             $information[] = Information::load($fname);
         }
     }
     return $information;
 }