<?php // DO NOT EDIT THIS FILE. // This file was generated by searchgen. // If you need to customize this file, please edit the corresponding // yaml file in the gencfg directory, and then re-generate this file // by running searchgen, passing in the table name. if (isset($command) && $command == 'loadPosting') { header('Content-Type: application/json'); $db = ConnectionFactory::getConnection(); $postingDAO = new PostingDAO($db); $id = isset($params['id']) ? (int) trim($params['id']) : 0; if ($id <= 0) { $rows = array(Posting::createDefault()); } else { $sql = <<<EOF select * from posting pri where pri.id = ? EOF; $ps = new PreparedStatement($sql, 0, 1); $ps->setInt($id); $rows = $postingDAO->findWithPreparedStatement($ps); } echo json_encode($rows); $db->close(); exit; }