本文整理汇总了PHP中Criteria::clearSelectColumns方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::clearSelectColumns方法的具体用法?PHP Criteria::clearSelectColumns怎么用?PHP Criteria::clearSelectColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criteria
的用法示例。
在下文中一共展示了Criteria::clearSelectColumns方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDraftApp
/**
* Get Application data by appUid
*
* @param string $app_uid Unique id of the app
* @param string $index
*
* return row app_cache_view
*
*/
public function getDraftApp($app_uid, $index = 1)
{
$c = new \Criteria('workflow');
$c->clearSelectColumns();
$c->addSelectColumn(\AppCacheViewPeer::APP_NUMBER);
$c->addSelectColumn(\AppCacheViewPeer::APP_STATUS);
$c->addSelectColumn(\AppCacheViewPeer::DEL_INDEX);
$c->addSelectColumn(\AppCacheViewPeer::APP_DEL_PREVIOUS_USER);
$c->addSelectColumn(\AppCacheViewPeer::DEL_DELEGATE_DATE);
$c->addSelectColumn(\AppCacheViewPeer::USR_UID);
$c->addSelectColumn(\AppCacheViewPeer::PRO_UID);
$c->addSelectColumn(\AppCacheViewPeer::APP_PRO_TITLE);
$c->addSelectColumn(\AppCacheViewPeer::APP_TAS_TITLE);
$c->addSelectColumn(\AppCacheViewPeer::DEL_THREAD_STATUS);
$c->addSelectColumn(\AppCacheViewPeer::TAS_UID);
$c->addSelectColumn(\AppCacheViewPeer::DEL_LAST_INDEX);
$c->add(\AppCacheViewPeer::APP_UID, $app_uid);
$c->add(\AppCacheViewPeer::DEL_INDEX, $index);
$rs = \AppCacheViewPeer::doSelectRS($c);
$rs->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$rows = array();
while ($rs->next()) {
$rows[] = $rs->getRow();
}
return $rows;
}
示例2: getCalendarBusinessHours
function getCalendarBusinessHours($CalendarUid)
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_UID);
$Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
$Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
$Criteria->addSelectColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_END);
$Criteria->add(CalendarBusinessHoursPeer::CALENDAR_UID, $CalendarUid, CRITERIA::EQUAL);
$Criteria->addDescendingOrderByColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_DAY);
$Criteria->addAscendingOrderByColumn(CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START);
//$Criteria->addDescendingOrderByColumn ( CalendarBusinessHoursPeer::CALENDAR_BUSINESS_START );
$rs = CalendarBusinessHoursPeer::doSelectRS($Criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$fields = array();
$count = 0;
while (is_array($row)) {
$count++;
$fields[$count] = $row;
$rs->next();
$row = $rs->getRow();
}
return $fields;
}
示例3: _getItemsPKsVotedByUsers
protected static function _getItemsPKsVotedByUsers($users_pks, $voting_attitude = null, $model = null)
{
$c = new Criteria();
$c->setDistinct();
$c->clearSelectColumns();
$c->addSelectColumn(self::VOTABLE_ID);
// analyze voting attitude
if (!is_null($voting_attitude)) {
if ($voting_attitude > 0) {
$c->add(self::VOTING, 0, Criteria::GREATER_THAN);
} elseif ($voting_attitude < 0) {
$c->add(self::VOTING, 0, Criteria::LESS_THAN);
} else {
$c->add(self::VOTING, 0);
}
}
$c->add(self::USER_ID, $users_pks, Criteria::IN);
if (!is_null($model)) {
$c->add(self::VOTABLE_MODEL, $model);
}
$rs = self::doSelectRS($c);
$pks = array();
while ($rs->next()) {
$pks[] = $rs->getInt(1);
}
return $pks;
}
示例4: getCalendarCriterias
function getCalendarCriterias($filter, $start, $limit)
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UID);
if ($filter != '') {
$Criteria->add($Criteria->getNewCriterion(CalendarDefinitionPeer::CALENDAR_NAME, '%' . $filter . '%', Criteria::LIKE)->addOr($Criteria->getNewCriterion(CalendarDefinitionPeer::CALENDAR_DESCRIPTION, '%' . $filter . '%', Criteria::LIKE)));
}
$Criteria->add(CalendarDefinitionPeer::CALENDAR_STATUS, 'DELETED', Criteria::NOT_EQUAL);
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UID);
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_NAME);
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_CREATE_DATE);
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_UPDATE_DATE);
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_DESCRIPTION);
$oCriteria->addSelectColumn(CalendarDefinitionPeer::CALENDAR_STATUS);
if ($filter != '') {
$oCriteria->add($oCriteria->getNewCriterion(CalendarDefinitionPeer::CALENDAR_NAME, '%' . $filter . '%', Criteria::LIKE)->addOr($oCriteria->getNewCriterion(CalendarDefinitionPeer::CALENDAR_DESCRIPTION, '%' . $filter . '%', Criteria::LIKE)));
}
$oCriteria->add(CalendarDefinitionPeer::CALENDAR_STATUS, 'DELETED', Criteria::NOT_EQUAL);
$oCriteria->setLimit($limit);
$oCriteria->setOffset($start);
$criterias = array();
$criterias['COUNTER'] = $Criteria;
$criterias['LIST'] = $oCriteria;
return $criterias;
}
示例5: _getAllBookmarkedIds
/**
* Return a hash with a list of ids of objects bookmarked (+|-) by a user
* bookmarked_ids = array('OppAtto' => array(1, 15, 143), ...);
*
* @param char(1) +|- type of bookmarking
* @param mixed $user_id User primary key
* @return array (see description)
**/
private static function _getAllBookmarkedIds($type, $user_id)
{
if ($type != '+' && $type != '-') {
throw new deppPropelActAsBookmarkableException('Type can only be + or -');
}
if (is_null($user_id) or trim((string) $user_id) === '') {
throw new deppPropelActAsBookmarkableException('Impossible to clear a user bookmarking with no user primary key provided');
}
$bookmarked_ids = array();
$c = new Criteria();
$c->add(sfBookmarkingPeer::USER_ID, $user_id);
$c->add(sfBookmarkingPeer::BOOKMARKING, $type == '+' ? 1 : -1);
$c->clearSelectColumns();
$c->addSelectColumn(sfBookmarkingPeer::BOOKMARKABLE_MODEL);
$c->addSelectColumn(sfBookmarkingPeer::BOOKMARKABLE_ID);
$rs = sfBookmarkingPeer::doSelectRS($c);
while ($rs->next()) {
$key = $rs->getString(1);
if (!array_key_exists($key, $bookmarked_ids)) {
$bookmarked_ids[$key] = array();
}
array_push($bookmarked_ids[$key], $rs->getInt(2));
}
return $bookmarked_ids;
}
示例6: getEmailEventServerAccounts
/**
* Get the email server accounts of the current workspace
*
* return array
*/
public function getEmailEventServerAccounts()
{
try {
$criteria = new \Criteria("workflow");
$criteria->clearSelectColumns();
$criteria->addSelectColumn(\EmailServerPeer::MESS_UID);
$criteria->addSelectColumn(\EmailServerPeer::MESS_FROM_MAIL);
$criteria->addSelectColumn(\EmailServerPeer::MESS_ACCOUNT);
$criteria->addAsColumn('UID', 'MESS_UID');
$result = \EmailServerPeer::doSelectRS($criteria);
$result->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$result->next();
$accountsArray = array();
while ($aRow = $result->getRow()) {
if ($aRow['MESS_UID'] != null) {
if($aRow['MESS_FROM_MAIL'] == "") {
$aRow['EMAIL'] = $aRow['MESS_ACCOUNT'];
} else {
$aRow['EMAIL'] = $aRow['MESS_FROM_MAIL'];
}
$accountsArray[] = array_change_key_case($aRow, CASE_LOWER);
}
$result->next();
}
return $accountsArray;
} catch (\Exception $e) {
throw $e;
}
}
示例7: getCalendarHolidays
public function getCalendarHolidays($CalendarUid)
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_UID);
$Criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_NAME);
$Criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_START);
$Criteria->addSelectColumn(CalendarHolidaysPeer::CALENDAR_HOLIDAY_END);
$Criteria->add(CalendarHolidaysPeer::CALENDAR_UID, $CalendarUid, CRITERIA::EQUAL);
$rs = CalendarHolidaysPeer::doSelectRS($Criteria);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
$fields = array();
$count = 0;
while (is_array($row)) {
$count++;
$a = explode(" ", $row['CALENDAR_HOLIDAY_START']);
$row['CALENDAR_HOLIDAY_START'] = $a[0];
$a = explode(" ", $row['CALENDAR_HOLIDAY_END']);
$row['CALENDAR_HOLIDAY_END'] = $a[0];
$fields[$count] = $row;
$rs->next();
$row = $rs->getRow();
}
return $fields;
}
示例8: getEquipmentMileage
public static function getEquipmentMileage($userId, $bikeId)
{
$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn('SUM(' . UserStatsPeer::MILEAGE . ')');
$c->addSelectColumn(UserEquipementPeer::EQUIPMENT_ID);
//$c->addGroupByColumn(UserRidesPeer::MILEAGE);
$c->add(UserEquipementPeer::USER_ID, $userId);
$c->add(UserEquipementPeer::BIKE_ID, $bikeId);
$c->addJoin(UserEquipementPeer::EQUIPMENT_ID, UserStatEquipPeer::USER_EQUIP_ID, Criteria::INNER_JOIN);
$c->addJoin(UserStatEquipPeer::USER_STAT_ID, UserStatsPeer::STAT_NO, Criteria::INNER_JOIN);
//$c->addJoin(UserStatsPeer::RIDE_KEY,UserRidesPeer::USER_RIDE_ID, Criteria::INNER_JOIN);
$c->addGroupByColumn(UserEquipementPeer::EQUIPMENT_ID);
$stmt = UserStatsPeer::doSelectStmt($c);
$hashmap = array();
if ($stmt) {
while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
if ($row) {
$sum = $row[0];
$eqId = $row[1];
//echo 'Mil '.$sum.' '.$eqId;
$hashmap[$eqId] = $sum;
// array_push($hashmap, $eqId=>$sum);
}
}
}
return $hashmap;
}
示例9: getRolesBySystem
/**
* Function getRolesBySystem
* access public
*/
function getRolesBySystem($SysUid, $UsrUid)
{
$con = Propel::getConnection(UsersRolesPeer::DATABASE_NAME);
try {
$c = new Criteria('rbac');
$c->clearSelectColumns();
$c->addSelectColumn(RolesPeer::ROL_UID);
$c->addSelectColumn(RolesPeer::ROL_CODE);
$c->addJoin(UsersRolesPeer::ROL_UID, RolesPeer::ROL_UID);
$c->add(UsersRolesPeer::USR_UID, $UsrUid);
$c->add(RolesPeer::ROL_SYSTEM, $SysUid);
$rs = UsersRolesPeer::doSelectRs($c);
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rs->next();
$row = $rs->getRow();
/* return only the first row, no other rows can be permitted
while ( is_array ( $row ) ) {
$rows[] = $row;
$rs->next();
$row = $rs->getRow();
}
*/
return $row;
} catch (Exception $oError) {
throw $oError;
}
}
示例10: getAllGroups
/**
* returns the groups in the given ramo (and for the given legislatura) and include the zero value, if given
*
* @param string $ramo
* @param int $legislatura
* @param string $include_zero
* @return an associative array, with id and name as key => value
* @author Guglielmo Celata
*/
public static function getAllGroups($ramo, $legislatura, $include_zero = false)
{
$c = new Criteria();
if ($ramo == 'camera') {
$c->add(OppCaricaPeer::TIPO_CARICA_ID, 1);
} else {
$c->add(OppCaricaPeer::TIPO_CARICA_ID, array(4, 5), Criteria::IN);
}
$c->addJoin(OppGruppoPeer::ID, OppCaricaHasGruppoPeer::GRUPPO_ID);
$c->addJoin(OppCaricaPeer::ID, OppCaricaHasGruppoPeer::CARICA_ID);
$c_or_leg = $c->getNewCriterion(OppCaricaPeer::LEGISLATURA, $legislatura);
$c_or_leg->addOr($c->getNewCriterion(OppCaricaPeer::LEGISLATURA, null, Criteria::ISNULL));
$c->add($c_or_leg);
$c->clearSelectColumns();
$c->addSelectColumn(OppGruppoPeer::ID);
$c->addSelectColumn(OppGruppoPeer::NOME);
$c->setDistinct();
$rs = OppGruppoPeer::doSelectRS($c);
if ($include_zero) {
$all_groups = array('0' => $include_zero);
} else {
$all_groups = array();
}
while ($rs->next()) {
$all_groups[$rs->getInt(1)] = $rs->getString(2);
}
return $all_groups;
}
示例11: getAttoIdsByTag
public static function getAttoIdsByTag($tag_id)
{
$c = new Criteria();
$c->add(self::TAG_ID, $tag_id);
$c->clearSelectColumns();
$c->addSelectColumn(self::ATTO_ID);
return self::doSelectRS($c);
}
示例12: getNotesList
public function getNotesList($appUid, $usrUid = '', $start = '', $limit = 25, $sort = 'APP_NOTES.NOTE_DATE', $dir = 'DESC', $dateFrom = '', $dateTo = '', $search = '')
{
$Criteria = new Criteria('workflow');
$Criteria->clearSelectColumns();
$Criteria->addSelectColumn(AppNotesPeer::APP_UID);
$Criteria->addSelectColumn(AppNotesPeer::USR_UID);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_DATE);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_CONTENT);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_TYPE);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AVAILABILITY);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_ORIGIN_OBJ);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ1);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_AFFECTED_OBJ2);
$Criteria->addSelectColumn(AppNotesPeer::NOTE_RECIPIENTS);
$Criteria->addSelectColumn(UsersPeer::USR_USERNAME);
$Criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
$Criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
$Criteria->addSelectColumn(UsersPeer::USR_EMAIL);
$Criteria->addJoin(AppNotesPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$Criteria->add(AppNotesPeer::APP_UID, $appUid, Criteria::EQUAL);
if ($usrUid != '') {
$Criteria->add(AppNotesPeer::USR_UID, $usrUid, Criteria::EQUAL);
}
if ($dateFrom != '') {
$Criteria->add(AppNotesPeer::NOTE_DATE, $dateFrom, Criteria::GREATER_EQUAL);
}
if ($dateTo != '') {
$Criteria->add(AppNotesPeer::NOTE_DATE, $dateTo, Criteria::LESS_EQUAL);
}
if ($search != '') {
$Criteria->add(AppNotesPeer::NOTE_CONTENT, '%' . $search . '%', Criteria::LIKE);
}
if ($dir == 'DESC') {
$Criteria->addDescendingOrderByColumn($sort);
} else {
$Criteria->addAscendingOrderByColumn($sort);
}
$response = array();
$totalCount = AppNotesPeer::doCount($Criteria);
$response['totalCount'] = $totalCount;
$response['notes'] = array();
if ($start != '') {
$Criteria->setLimit($limit);
$Criteria->setOffset($start);
}
$oDataset = appNotesPeer::doSelectRS($Criteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
$response['notes'][] = $aRow;
$oDataset->next();
}
$result['criteria'] = $Criteria;
$result['array'] = $response;
return $result;
}
示例13: getAllDistinctRouteId
/**
*
* @return Routes2011[]
*/
public static function getAllDistinctRouteId()
{
$criteria = new Criteria();
$criteria->addAscendingOrderByColumn(self::ROUTEID);
$criteria->setDistinct();
$criteria->clearSelectColumns();
$criteria->addSelectColumn(self::ROUTEID);
return self::doSelect($criteria);
}
示例14: retrieveAllCredentialsForARole
/**
* Returns all credentials (permission names) for the role given
*/
public static function retrieveAllCredentialsForARole($role)
{
$c = new Criteria();
$c->add(sfGuardGroupPermissionPeer::GROUP_ID, $role->getId());
$c->addJoin(sfGuardGroupPermissionPeer::PERMISSION_ID, self::ID);
$c->clearSelectColumns();
$c->addSelectColumn(self::NAME);
$stmt = self::doSelectStmt($c);
return $stmt->fetchAll(PDO::FETCH_COLUMN);
}
示例15: getPropertyNames
/**
* description
*
* @return return_type
* @param var_type $var
*/
public static function getPropertyNames()
{
$c = new Criteria();
$c->clearSelectColumns()->addSelectColumn(SkosPropertyPeer::ID);
$c->addSelectColumn(self::NAME);
$rs = SkosPropertyPeer::doSelectRS($c);
while ($rs->next()) {
$results[$rs->getString(2)] = $rs->getInt(1);
}
return $results;
}