本文整理匯總了PHP中StudentPeer::doSelectJoinPerson方法的典型用法代碼示例。如果您正苦於以下問題:PHP StudentPeer::doSelectJoinPerson方法的具體用法?PHP StudentPeer::doSelectJoinPerson怎麽用?PHP StudentPeer::doSelectJoinPerson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類StudentPeer
的用法示例。
在下文中一共展示了StudentPeer::doSelectJoinPerson方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getAssociatedStudentsList
/**
* Returns a string with list items <li> of associated students
*
* @param $name Represents widget's name
* @param array $student_ids array of integer representing student ids
* @return string
*/
public static function getAssociatedStudentsList($name, $student_ids, $fixed_values = array())
{
$ret = '';
$criteria = new Criteria();
$criteria->addAscendingOrderByColumn(PersonPeer::LASTNAME);
$criteria->addAnd(StudentPeer::ID, $student_ids, Criteria::IN);
$students = StudentPeer::doSelectJoinPerson($criteria);
$name .= "[]";
foreach ($students as $s) {
$fixed = in_array($s->getId(), $fixed_values);
$checkbox = $fixed ? " " : "<input type='checkbox' name='checkbox_{$name}' />";
$fixed_class = $fixed ? 'fixed' : '';
$hidden_widget = new sfWidgetFormInputHidden();
$hidden = $hidden_widget->render($name, $s->getId());
$ret .= "<li class='associated_student {$fixed_class}'><span>{$checkbox}</span>{$s} {$hidden}</li>";
}
return $ret;
}