本文整理汇总了PHP中Model_User::getUserByAccountId方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_User::getUserByAccountId方法的具体用法?PHP Model_User::getUserByAccountId怎么用?PHP Model_User::getUserByAccountId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model_User
的用法示例。
在下文中一共展示了Model_User::getUserByAccountId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: organisationAction
public function organisationAction()
{
if ($_GET['reporting_org']) {
$reportingOrg = $this->_request->getParam('reporting_org');
} else {
$this->_redirect('organisation?reporting_org=all');
}
!$reportingOrg ? $handler = new Iati_Snapshot_Lib_DataHandler() : ($handler = new Iati_Snapshot_Lib_DataHandler($reportingOrg));
$accountModel = new User_Model_DbTable_Account();
$userModel = new Model_User();
$publishModel = new Model_Published();
$wepModel = new Model_Wep();
$regInfoModel = new Model_RegistryInfo();
$result = $accountModel->getAccountByOrganisation($reportingOrg);
if (count($result)) {
// Get Account Id
$accountId = $result['id'];
$user = $userModel->getUserByAccountId($accountId);
$regInfo = $regInfoModel->getOrgRegistryInfo($accountId);
// Get Organisation Info
$organisation_array['name'] = $result['name'];
$organisation_array['image'] = $result['file_name'];
$organisation_array['address'] = $result['address'];
$organisation_array['email'] = $user['email'];
$organisation_array['telephone'] = $result['telephone'] ? $result['telephone'] : 'Not Available';
$organisation_array['website'] = $result['url'] ? $result['url'] : 'Not Available';
$organisation_array['twitter'] = $result['twitter'] ? $result['twitter'] : 'Not Available';
$organisation_array['prefix'] = $result['username'];
$organisation_array['disqus_comments'] = $result['disqus_comments'];
$this->view->organisation_array = $organisation_array;
$this->view->publisher_id = $regInfo->publisher_id;
} else {
// For all organisations: snapshot
if ($reportingOrg == 'all' || $reportingOrg == '') {
$activityModel = new Model_Activity();
$orgData = $activityModel->allOrganisationsActivityStates();
foreach ($orgData as $key => $row) {
$total['activities'] += array_sum($row['states']);
$total['published'] += $row['registry_published_count'];
}
$accountModel = new User_Model_DbTable_Account();
$count = $accountModel->getAccountCount();
$total['organisations'] = $count['total'];
$this->view->total = $total;
} else {
$this->_redirect('organisation?reporting_org=all');
}
}
// end if
$this->view->handler = $handler;
}
示例2: listOrganisationAction
public function listOrganisationAction()
{
$identity = Zend_Auth::getInstance()->getIdentity();
$userId = $identity->user_id;
$userModel = new Model_User();
$groupModel = new User_Model_DbTable_Group();
$userGroupModel = new User_Model_DbTable_UserGroup();
$activityModel = new Model_ActivityCollection();
$group = $userGroupModel->getRowByUserId($userId);
$orgs = $groupModel->getAllOrganisationsByGroupId($group['group_id']);
$org_data = array();
foreach ($orgs as $organisation) {
$users = $userModel->getUserCountByAccountId($organisation['account_id']);
$organisation['users_count'] = $users[0]['users_count'];
$activities = $activityModel->getActivitiesCountByAccount($organisation['account_id']);
$organisation['activity_count'] = $activities[0]['activity_count'];
$user = $userModel->getUserByAccountId($organisation['account_id'], array('role_id' => 1));
$organisation['user_id'] = $user['user_id'];
$org_data[] = $organisation;
}
$this->view->groupRow = $group;
$this->view->rowSet = $org_data;
}
示例3: editOrganisationAction
public function editOrganisationAction()
{
if ($this->getRequest()->isGet()) {
$org_info = array();
$id = $this->_request->getParam('id');
$model = new Model_Wep();
$rowSet = $model->getRowById('account', 'id', $id);
$org_info['organisation_name'] = $rowSet['name'];
$org_info['organisation_address'] = $rowSet['address'];
$org_info['organisation_username'] = $rowSet['username'];
$userModel = new Model_User();
$user_info = $userModel->getUserByAccountId($rowSet['id'], array('role_id' => 1));
$user_profile = $model->getRowById('profile', 'user_id', $user_info['user_id']);
$user = $model->getRowById('user', 'user_id', $user_info['user_id']);
$user_info['admin_username'] = $user['user_name'];
//Create edit form
$defaultFieldsValues = $model->getDefaults('default_field_values', 'account_id', $rowSet['id']);
$default['field_values'] = $defaultFieldsValues->getDefaultFields();
$defaultFieldGroup = $model->getDefaults('default_field_groups', 'account_id', $rowSet['id']);
$default['fields'] = $defaultFieldGroup->getProperties();
$form = new Form_Wep_Accountregister();
$form->add($default);
$form->addElement('hidden', 'org_id', array('value' => $rowSet['id']));
$form->addElement('hidden', 'user_id', array('value' => $user_info['user_id']));
$form->addElement('hidden', 'profile_id', array('value' => $user_profile['id']));
$form->populate($org_info);
$form->populate($user_info);
$form->populate($user_profile);
//Disable name and username as they should not be edited
$form->organisation_name->setAttrib('readonly', 'true');
$form->organisation_username->setAttrib('readonly', 'true');
$form->admin_username->setAttrib('readonly', 'true');
$form->Signup->setLabel('Save');
$form->setAction($this->view->baseUrl() . '/admin/update-organisation');
$this->view->form = $form;
}
}