本文整理汇总了PHP中ApplicationPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationPeer::doCount方法的具体用法?PHP ApplicationPeer::doCount怎么用?PHP ApplicationPeer::doCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationPeer
的用法示例。
在下文中一共展示了ApplicationPeer::doCount方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generatedReport1_filter
/**
* This function does a sql statment to a report wiht a condition
* or maybe when you're looking for some specials cases
*
* @name generatedReport1_filter
*
* @param string $from
* @param string $to
* @param string $startedby
* @return object
*/
function generatedReport1_filter($from, $to, $startedby)
{
$this->reportsPatch();
require_once 'classes/model/AppDelegation.php';
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$del = DBAdapter::getStringDelimiter();
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(AppDelegationPeer::PRO_UID);
$oCriteria->addAsColumn("MIN", "MIN(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn("MAX", "MAX(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn("TOTALDUR", "SUM(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn("PROMEDIO", "AVG(" . AppDelegationPeer::DEL_DURATION . ")");
$oCriteria->addAsColumn('PRO_TITLE', 'C1.CON_VALUE');
$oCriteria->addAlias("C1", 'CONTENT');
$proTitleConds = array();
$proTitleConds[] = array(AppDelegationPeer::PRO_UID, 'C1.CON_ID');
$proTitleConds[] = array('C1.CON_CATEGORY', $del . 'PRO_TITLE' . $del);
$proTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
$oCriteria->addJoinMC($proTitleConds, Criteria::LEFT_JOIN);
$oCriteria->addJoin(AppDelegationPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
//$oCriteria->add(AppDelegationPeer::DEL_DURATION, $from, Criteria::GREATER_EQUAL);
//$oCriteria->add(AppDelegationPeer::DEL_DURATION, $to, Criteria::LESS_EQUAL);
//$aAux1 = explode('-', $from); date('Y-m-d H:i:s', mktime(0, 0, 0, $aAux1[1], $aAux1[2], $aAux1[0]))
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $from . ' 00:00:00', Criteria::GREATER_EQUAL)->addAnd($oCriteria->getNewCriterion(AppDelegationPeer::DEL_INIT_DATE, $to . ' 23:59:59', Criteria::LESS_EQUAL)));
if ($startedby != '') {
$oCriteria->add(ApplicationPeer::APP_INIT_USER, $startedby);
}
$oCriteria->addGroupByColumn(AppDelegationPeer::PRO_UID);
$oCriteria->addGroupByColumn('C1.CON_VALUE');
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aProcess[] = array('PRO_UID' => 'char', 'PRO_TITLE' => 'char', 'CANTCASES' => 'integer', 'MIN' => 'float', 'MAX' => 'float', 'TOTALDUR' => 'float', 'PROMEDIO' => 'float');
while ($aRow = $oDataset->getRow()) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
$oCriteria->add(ApplicationPeer::PRO_UID, $aRow['PRO_UID']);
if ($startedby != '') {
$oCriteria->add(ApplicationPeer::APP_INIT_USER, $startedby);
}
$aProcess[] = array('PRO_UID' => $aRow['PRO_UID'], 'PRO_TITLE' => $aRow['PRO_TITLE'], 'CANTCASES' => ApplicationPeer::doCount($oCriteria), 'MIN' => number_format($aRow['MIN'], 2), 'MAX' => number_format($aRow['MAX'], 2), 'TOTALDUR' => number_format($aRow['TOTALDUR'], 2), 'PROMEDIO' => number_format($aRow['PROMEDIO'], 2));
$oDataset->next();
}
global $_DBArray;
$_DBArray['reports'] = $aProcess;
$_SESSION['_DBArray'] = $_DBArray;
G::LoadClass('ArrayPeer');
$oCriteria = new Criteria('dbarray');
$oCriteria->setDBArrayTable('reports');
return $oCriteria;
}
示例2: getWorkspaceInfo
/**
* Will return all the information of a WS.
* - Status
* - # of cases
* - # of processes
* - # of users
* @param string $wsName
* @return array
*/
function getWorkspaceInfo($wsName)
{
$aResult = array('num_processes' => '0', 'num_cases' => '0');
$result = array();
require_once 'classes/model/Process.php';
require_once 'classes/model/Application.php';
require_once 'classes/model/Users.php';
$Criteria = new Criteria('workflow');
$Criteria->add(ProcessPeer::PRO_STATUS, 'ACTIVE', CRITERIA::EQUAL);
$aResult['num_processes'] = ProcessPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(ApplicationPeer::APP_STATUS, 'COMPLETED', CRITERIA::NOT_EQUAL);
$aResult['num_cases'] = ApplicationPeer::doCount($Criteria);
$Criteria = new Criteria('workflow');
$Criteria->add(UsersPeer::USR_STATUS, array('DELETED', 'DISABLED'), CRITERIA::NOT_IN);
$aResult['num_users'] = UsersPeer::doCount($Criteria);
return $aResult;
}
示例3: getSearchAllCount
public function getSearchAllCount()
{
$criteriaCount = new Criteria('workflow');
$totalCount = ApplicationPeer::doCount($criteriaCount);
return $totalCount;
}
示例4: Cases
echo G::json_encode($result);
break;
case 'canDeleteUser':
G::LoadClass('case');
$oProcessMap = new Cases();
$USR_UID = $_POST['uUID'];
$total = 0;
$history = 0;
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$total += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$total += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$history += ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$history += ApplicationPeer::doCount($c);
$response = '{success: true, candelete: ';
$response .= $total > 0 ? 'false' : 'true';
$response .= ', hashistory: ';
$response .= $history > 0 ? 'true' : 'false';
$response .= '}';
echo $response;
break;
case 'deleteUser':
$UID = $_POST['USR_UID'];
G::LoadClass('tasks');
$oTasks = new Tasks();
$oTasks->ofToAssignUserOfAllTasks($UID);
G::LoadClass('groups');
$oGroups = new Groups();
$oGroups->removeUserOfAllGroups($UID);
示例5: getCountApplicationsPMOS2
/**
* Get the total number of application records in database
*
* @return integer application counter
*/
public function getCountApplicationsPMOS2()
{
$c = new Criteria();
$c->addSelectColumn(ApplicationPeer::APP_UID);
$count = ApplicationPeer::doCount($c);
return $count;
}
示例6: delete
/**
* Delete User
*
* @param string $usrUid Unique id of User
*
* return void
*/
public function delete($usrUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsUser($usrUid, $this->arrayFieldNameForException["usrUid"]);
\G::LoadClass('case');
$oProcessMap = new \Cases();
$USR_UID = $usrUid;
$total = 0;
$history = 0;
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$total += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$total += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$history += \ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$history += \ApplicationPeer::doCount($c);
if ($total > 0) {
throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_BE_DELETED", array($USR_UID)));
} else {
$UID = $usrUid;
\G::LoadClass('tasks');
$oTasks = new \Tasks();
$oTasks->ofToAssignUserOfAllTasks($UID);
\G::LoadClass('groups');
$oGroups = new \Groups();
$oGroups->removeUserOfAllGroups($UID);
$this->changeUserStatus($UID, 'CLOSED');
$_GET['USR_USERNAME'] = '';
$this->updateUser(array('USR_UID' => $UID, 'USR_USERNAME' => $_GET['USR_USERNAME']), '');
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "Users.php");
$oUser = new \Users();
$aFields = $oUser->load($UID);
$aFields['USR_STATUS'] = 'CLOSED';
$aFields['USR_USERNAME'] = '';
$oUser->update($aFields);
//Delete Dashboard
require_once (PATH_TRUNK . "workflow" . PATH_SEP . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashletInstance.php");
$criteria = new \Criteria( 'workflow' );
$criteria->add( \DashletInstancePeer::DAS_INS_OWNER_UID, $UID );
$criteria->add( \DashletInstancePeer::DAS_INS_OWNER_TYPE , 'USER');
//.........这里部分代码省略.........
示例7: Publisher
$G_PUBLISH = new Publisher();
if ($_GET['USR_UID'] != '') {
$c = 0;
$oTemplatePower = new TemplatePower(PATH_TPL . 'users/users_DeleteReassign.html');
$oTemplatePower->prepare();
G::LoadClass('tasks');
G::LoadClass('groups');
$oTasks = new Tasks();
$oGroups = new Groups();
$oUser = new Users();
G::LoadClass('case');
$oCases = new Cases();
$USR_UID = $_GET['USR_UID'];
list($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList('to_do', $_GET['USR_UID']);
list($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList('draft', $_GET['USR_UID']);
if (ApplicationPeer::doCount($oCriteriaToDo) == 0 && ApplicationPeer::doCount($oCriteriaDraft) == 0) {
}
G::header('location: users_Delete?USR_UID=' . $USR_UID);
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$c++;
$oTemplatePower->newBlock('cases');
$aKeys = array_keys($aRow);
foreach ($aKeys as $sKey) {
$oTemplatePower->assign($sKey, $aRow[$sKey]);
}
$aUsers = array($_GET['USR_UID']);
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
foreach ($aAux1 as $aGroup) {
示例8: countApplications
/**
* Returns the number of related Application objects.
*
* @param Criteria $criteria
* @param boolean $distinct
* @param PropelPDO $con
* @return int Count of related Application objects.
* @throws PropelException
*/
public function countApplications(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
{
if ($criteria === null) {
$criteria = new Criteria(VocationClassPeer::DATABASE_NAME);
} else {
$criteria = clone $criteria;
}
if ($distinct) {
$criteria->setDistinct();
}
$count = null;
if ($this->collApplications === null) {
if ($this->isNew()) {
$count = 0;
} else {
$criteria->add(ApplicationPeer::VOCATION_CLASS_ID, $this->id);
$count = ApplicationPeer::doCount($criteria, $con);
}
} else {
// criteria has no effect for a new object
if (!$this->isNew()) {
// the following code is to determine if a new query is
// called for. If the criteria is the same as the last
// one, just return count of the collection.
$criteria->add(ApplicationPeer::VOCATION_CLASS_ID, $this->id);
if (!isset($this->lastApplicationCriteria) || !$this->lastApplicationCriteria->equals($criteria)) {
$count = ApplicationPeer::doCount($criteria, $con);
} else {
$count = count($this->collApplications);
}
} else {
$count = count($this->collApplications);
}
}
return $count;
}
示例9: Cases
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
$USR_UID = $_GET['USR_UID'];
G::LoadClass('case');
$oProcessMap = new Cases();
$c = $oProcessMap->getCriteriaUsersCases('TO_DO', $USR_UID);
$array["TO_DO"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('COMPLETED', $USR_UID);
$array["COMPLETED"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('DRAFT', $USR_UID);
$array["DRAFT"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaUsersCases('CANCELLED', $USR_UID);
$array["CANCELLED"] = ApplicationPeer::doCount($c);
$array["USR_UID"] = $USR_UID;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'users/users_DeleteAssign', '', $array, '');
G::RenderPage('publish', 'raw');
示例10: Cases
{
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
*/
$PRO_UID = $_GET['PRO_UID'];
require_once 'classes/model/Process.php';
G::LoadClass('case');
$oProcessMap = new Cases();
$process = new Process();
$processData = $process->load($PRO_UID);
$c = $oProcessMap->getCriteriaProcessCases('TO_DO', $PRO_UID);
$processData["TO_DO"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaProcessCases('COMPLETED', $PRO_UID);
$processData["COMPLETED"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaProcessCases('DRAFT', $PRO_UID);
$processData["DRAFT"] = ApplicationPeer::doCount($c);
$c = $oProcessMap->getCriteriaProcessCases('CANCELLED', $PRO_UID);
$processData["CANCELLED"] = ApplicationPeer::doCount($c);
$processData["PRO_UID"] = $PRO_UID;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_DeleteCases', '', $processData, 'processes_Delete.php');
G::RenderPage('publish', 'raw');