本文整理汇总了PHP中Teacher::get_by_person方法的典型用法代码示例。如果您正苦于以下问题:PHP Teacher::get_by_person方法的具体用法?PHP Teacher::get_by_person怎么用?PHP Teacher::get_by_person使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Teacher
的用法示例。
在下文中一共展示了Teacher::get_by_person方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRemembersPerson
function testRemembersPerson()
{
$fakename = 'Bob Dobalina';
$p = new Person(array('id' => 4, 'name' => $fakename));
$x = Teacher::get_by_person($p);
$this->assertEquals(1, $x->id);
$this->assertEquals($fakename, $x->name());
}
示例2: isset
}
########### IDENTIFICATION
$p = Person::get_by_cookie();
# lopass interception: http://songwork.com/home/1234/ab8f
# not full auth, only to have existing client's name & address pre-filled from database for forms
if ($p === false && isset($_SERVER['PATH_INFO']) && preg_match('/\\/(\\d*)\\/([0-9a-zA-Z]{4})$/', $_SERVER['PATH_INFO'], $matches)) {
$possible_id = $matches[1];
$possible_lopass = $matches[2];
$pp = Person::get_by_id_lopass($possible_id, $possible_lopass);
if ($pp !== false) {
$pp->set_welcome_cookie();
$p = $pp;
}
}
$student = Student::get_by_person($p);
$teacher = Teacher::get_by_person($p);
$admin = Administrator::get_by_person($p);
$qv['p'] = $p;
$qv['student'] = $student;
$qv['teacher'] = $teacher;
$qv['admin'] = $admin;
$currency = 'USD';
# TODO: dynamic. set in Person?
$qv['currency'] = $currency;
# name / email - FOR PRE-FILLING FORMS AND HEADERS
if ($p) {
$qv['name'] = $p->name();
$qv['email'] = $p->email();
} else {
$qv['name'] = isset($_COOKIE['name']) ? $_COOKIE['name'] : '';
$qv['email'] = isset($_COOKIE['email']) ? $_COOKIE['email'] : '';