本文整理汇总了PHP中Teacher::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::update方法的具体用法?PHP Teacher::update怎么用?PHP Teacher::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teacher
的用法示例。
在下文中一共展示了Teacher::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: photo_POST
function photo_POST($id)
{
$teacher = new Teacher($id);
$src = make_image('photo');
$teacher->update('photo', $src);
redirect("teacher/{$id}");
}
示例2: edit_teacher_POST
function edit_teacher_POST($id)
{
$description = _post('description');
$teacher = new Teacher($id);
if ($description) {
$teacher->update('description', $description);
}
redirect("teacher/{$id}/edit");
}
示例3: createPersonContext
/**
* Creates Indicate2 person context by teacher data
*
* @param array $teacherData Teacher data (intern)
* @param boolean=true $dbAction Update person context id
*
* @return int
*
* @throws Indicate2_Exception
*/
public function createPersonContext($teacherData, $dbAction = true)
{
try {
if (empty($this->_client)) {
$this->connect();
}
$teacherPrefix = getTeacherPrefix();
$teacherModel = new Teacher();
// create request
$createPersonContextRequest = array('CreatePersonContextRequest' => array('PersonContext' => array('Name' => $teacherModel->getNameByData($teacherData), 'Description' => ($divisionLongname = $teacherModel->getDivisionByData($teacherData)) ? $divisionLongname : '', 'Image' => $teacherData[$teacherPrefix . 'photo'], 'PageBreak' => false)));
// call public function to create person context
$response = $this->_client->__soapCall('CreatePersonContext', $createPersonContextRequest);
if ($dbAction) {
// write new person context id from indicate2 to teacher in tuevalon2
$teacherModel->update(array($teacherPrefix . 'indicate2personcontextid' => intval($response->ContextId)), array($teacherPrefix . 'id = ' . intval($teacherData[$teacherPrefix . 'id']), $teacherPrefix . 'indicate2ws = ' . $teacherModel->getAdapter()->quote(getIndicate2WSDL()), $teacherPrefix . 'indicate2user = ' . $teacherModel->getAdapter()->quote(getIndicate2User())));
}
return $response->ContextId;
} catch (Exception $e) {
throw new Indicate2_Exception($e->getMessage());
}
}
示例4: Teacher
<?php
require_once "../init.php";
$teacher = new Teacher(new PDOdb("mysql:host=localhost;dbname=usjr", "root", ""));
$teacherid = $_POST['tchid'];
$teacherfname = $_POST['tchfname'];
$teachermname = $_POST['tchmname'];
$teacherlname = $_POST['tchlname'];
$teachertitle = $_POST['tchtitle'];
$teachertype = $_POST['tchtype'];
$result = $teacher->update(array('teacherfname' => $teacherfname, 'teachermname' => $teachermname, 'teacherlname' => $teacherlname, 'teachertitle' => $teachertitle, 'teachertype' => $teachertype), array('teacherid' => $teacherid), 1);
header('Location:teacherUpdateList.php');