本文整理汇总了PHP中Course::setConnector方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::setConnector方法的具体用法?PHP Course::setConnector怎么用?PHP Course::setConnector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::setConnector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
public function getList($order = "didascalia")
{
$order = trim(filter_var($order, FILTER_SANITIZE_STRING));
//interrogazione tabella
$sql = "SELECT * FROM upload ORDER BY {$order}";
$auth = $this->connector->query($sql);
$list = array();
// controllo sul risultato dell'interrogazione
if (mysql_num_rows($auth) > 0) {
$doc = new Document();
$doc->setConnector($this->connector);
$course = new Course();
$course->setConnector($this->connector);
while ($res = $this->connector->getObjectResult($auth)) {
$doc = new Document($res->id, $res->path, $res->tipo, $res->didascalia);
//Calcolo le informazioni di servizio
if ($res->tipo == 1) {
$doc->course_name = "TUTTI";
} else {
$doc->course_name = $course->getById($res->tipo)->name;
}
$list[] = $doc;
}
}
return $list;
}
示例2: getById
public function getById($id)
{
$id = (int) $id;
$sql = "SELECT * FROM piani WHERE id_piano='{$id}' LIMIT 1";
$auth = $this->connector->query($sql);
if (mysql_num_rows($auth) > 0) {
//Inializzo le classi di servizio
$course = new Course();
$course->setConnector($this->connector);
$subjectPlan = new SubjectPlan();
$subjectPlan->setConnector($this->connector);
$res = $this->connector->getObjectResult($auth);
//Recupero la lista delle entries
$sub_list = $subjectPlan->getList($res->id_piano, "anno");
$plan = new Plan($res->id_piano, $res->codice, $res->id_corso, $sub_list);
//Calcolo le informazioni di servizio
$plan->course_name = $course->getById($plan->course_id)->name;
//ritorno il piano cercato
return $plan;
}
return false;
}
示例3: getById
public function getById($id)
{
// interrogazione della tabella
$sql = "SELECT * FROM studenti WHERE id_studente='{$id}'";
$auth = $this->connector->query($sql);
$student = null;
if (mysql_num_rows($auth) > 0) {
$res = $this->connector->getObjectResult($auth);
$student = new Student(get_object_vars($res));
}
//Gestisco i dati di servizio
$plan = new Plan();
$plan->setConnector($this->connector);
$student_plan = $plan->getById($student->id_plan);
$student->course_id = $student_plan->course_id;
$course = new Course();
$course->setConnector($this->connector);
$student_course = $course->getById($student->course_id);
$student->course_name = $student_course->name;
$student->course_year = $student_course->years;
return $student;
}
示例4: showCourse
function showCourse()
{
global $connector;
$page = "course.php";
$course = new Course();
$course->setConnector($connector);
if ($_POST['operation']) {
list($operation, $params) = explode("#", $_POST['operation']);
switch ($operation) {
case 'saveChanges':
$course->storeFormValues($_POST);
$error_msg = $course->insert();
if ($error_msg) {
$result['edit'] = $course;
}
break;
case 'delete':
$error_msg = $course->delete($params);
break;
case 'edit':
$result['edit'] = $course->getById($params);
break;
case 'editChanges':
$course->storeFormValues($_POST);
$error_msg = $course->update();
break;
default:
$error_msg = "Operazione non valida";
}
if ($error_msg != "") {
$result["errorMessage"] = $error_msg;
} elseif ($operation != 'edit') {
$result["statusMessage"] = "Operazione completata!";
}
}
if (isset($_POST['search'])) {
$result["courses"] = $course->search($_POST['search']);
} else {
$result["courses"] = $course->getList();
}
$page = "course.php";
include_once BASE_PATH . "template.php";
}