Пример #1
0
 public function __construct(Querier $db)
 {
     $this->connection = $db->getConnection();
     $statement = $this->connection->prepare("SELECT title_id FROM title");
     $statement->execute();
     $title_ids = $statement->fetchAll();
     foreach ($title_ids as $title_id) {
         $azrecord = new AzRecord($db);
         $azrecord->getRecord($title_id['title_id']);
         $this->records[] = $azrecord->toArray();
     }
 }
Пример #2
0
<?php

include "../includes/autoloader.php";
include "../includes/config.php";
use SubjectsPlus\Control\Querier;
use SubjectsPlus\Control\AzRecord\AzRecord;
$db = new Querier();
$record = new AzRecord($db);
$record->getRecord((int) $_GET['id']);
header('Content-Type: application/json');
echo $record->toJSON();