本文整理汇总了PHP中Roles::getAdapter方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::getAdapter方法的具体用法?PHP Roles::getAdapter怎么用?PHP Roles::getAdapter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roles
的用法示例。
在下文中一共展示了Roles::getAdapter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editsystemroleAction
/** Edit a system role
*/
public function editsystemroleAction()
{
$form = new SystemRoleForm();
$this->view->form = $form;
if ($this->_request->isPost()) {
$formData = $this->_request->getPost();
if ($form->isValid($formData)) {
$roles = new Roles();
$updateData = array('role' => $form->getValue('role'), 'description' => $form->getValue('description'), 'updated' => $this->getTimeForForms(), 'updatedBy' => $this->getIdentityForForms());
$where = array();
$where[] = $roles->getAdapter()->quoteInto('id = ?', $this->_getParam('id'));
$update = $roles->update($updateData, $where);
$this->_flashMessenger->addMessage($form->getValue('role') . '\'s details updated.');
$this->_redirect('/admin/systemroles/');
} else {
$form->populate($formData);
}
} else {
// find id is expected in $params['id']
$id = (int) $this->_request->getParam('id', 0);
if ($id > 0) {
$roles = new Roles();
$roles = $roles->fetchRow('id=' . $id);
$form->populate($roles->toArray());
}
}
}
示例2: findRolesCandidats
function findRolesCandidats($annee)
{
$t = new Roles();
$db = $t->getAdapter();
$s = $t->select()->setIntegrityCheck(false)->from('unite_role')->join('unite_type', 'unite_type.id = unite_role.type', array())->join('unite', 'unite.type = unite_type.id', array())->joinLeft('appartenance', 'appartenance.role = unite_role.id AND ' . 'appartenance.unite = unite.id AND ' . ('(' . $db->quoteInto('appartenance.debut < ?', Strass_Controller_Action_Helper_Annee::dateFin($annee)) . ' AND ' . $db->quoteInto('(appartenance.fin IS NULL OR appartenance.fin < ?)', Strass_Controller_Action_Helper_Annee::dateFin($annee)) . ')'), array())->where('unite.id = ?', $this->id)->where('appartenance.id IS NULL');
return $t->fetchAll($s);
}
示例3: findRolesCandidats
function findRolesCandidats($unite, $filter_current = true)
{
$t = new Roles();
$db = $t->getAdapter();
$s = $t->select()->setIntegrityCheck(false)->from('unite_role')->join('unite_type', 'unite_type.id = unite_role.type', array())->join('unite', 'unite.type = unite_type.id', array())->where('unite.id = ?', $unite->id);
if ($filter_current) {
$s->joinLeft('appartenance', 'appartenance.role = unite_role.id AND ' . 'appartenance.unite = unite.id AND ' . $db->quoteInto('appartenance.individu', $this->id), array())->where('appartenance.id IS NULL');
}
return $t->fetchAll($s);
}