protected function getLibrarian() { if ($this->librarian !== null) { return $this->librarian; } $l = new Librarian($this->librarianNamespace, ['db' => $this->pdo, 'path' => $this->librarianPath, 'type' => $this->librarianType], $this->getLibrarianIndexes()); $l->buildEnvironment(); $this->librarian = $l; return $this->librarian; }
<?php // Some basic utility functions require_once "includes/utility.php"; // Load, instantiate Librarian class require_once "includes/class.librarian.php"; $Librarian = new Librarian(); // Build the library $Librarian->make_library(); // Bootstrap the downloader too. Downloads submit to self. $Librarian->init_downloader(); // Bootstrap the raw viewer for markup $Librarian->view_raw(); // Load the theme functions require_once "theme/functions.php"; // Load the theme template file require_once "theme/index.php";
/** * Deletes a librarian * * @param string $id */ public function deleteAction($id) { $librarian = Librarian::findFirstByid($id); if (!$librarian) { $this->flash->error("librarian was not found"); return $this->dispatcher->forward(array("controller" => "librarian", "action" => "index")); } if (!$librarian->delete()) { foreach ($librarian->getMessages() as $message) { $this->flash->error($message); } return $this->dispatcher->forward(array("controller" => "librarian", "action" => "search")); } $this->flash->success("librarian was deleted successfully"); return $this->dispatcher->forward(array("controller" => "librarian", "action" => "index")); }