Esempio n. 1
0
 static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Esempio n. 2
0
<?php

include './sermon.php';
include './sermon_repository.php';
header('Content-type/application-json');
try {
    $sermonRepository = sermon_repository::getInstance();
    $sermons = $sermonRepository->getAll();
    echo json_encode($sermons);
} catch (Exception $e) {
    echo $e->getMessage();
}