当前位置: 首页>>代码示例>>PHP>>正文


PHP uiConfPeer::doCount方法代码示例

本文整理汇总了PHP中uiConfPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP uiConfPeer::doCount方法的具体用法?PHP uiConfPeer::doCount怎么用?PHP uiConfPeer::doCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uiConfPeer的用法示例。


在下文中一共展示了uiConfPeer::doCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     $this->applyPartnerFilterForClass('uiConf', $partner_id);
     $detailed = $this->getP("detailed", false);
     $detailed_fields = $this->getP("detailed_fields");
     $limit = $this->getP("page_size", 10);
     $limit = $this->maxPageSize($limit);
     $page = $this->getP("page", 1);
     $offset = ($page - 1) * $limit;
     $c = new Criteria();
     // filter
     $filter = new uiConfFilter();
     $fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null);
     $this->setExtraFilters($filter);
     $filter->attachToCriteria($c);
     $count = uiConfPeer::doCount($c);
     if ($count > 0) {
         $offset = ($page - 1) * $limit;
         $c->setLimit($limit);
         if ($offset > 0) {
             $c->setOffset($offset);
         }
         $list = uiConfPeer::doSelect($c);
         $level = $detailed ? objectWrapperBase::DETAIL_LEVEL_DETAILED : objectWrapperBase::DETAIL_LEVEL_REGULAR;
     } else {
         // no need to query the data - there is none !
         $list = array();
         $level = objectWrapperBase::DETAIL_LEVEL_REGULAR;
     }
     $this->addMsg("count", $count);
     $this->addMsg("page_size", $limit);
     $this->addMsg("page", $page);
     foreach ($list as $listed_uiConf) {
         if (!$listed_uiConf->isValid()) {
             $this->addError(APIErrors::INTERNAL_SERVERL_ERROR, "uiConf object [{$listed_uiConf->getId()}] is not valid");
             return;
         }
     }
     if ($detailed_fields) {
         $extra_fields = explode(",", $detailed_fields);
         $wrapper = objectWrapperBase::getWrapperClass($list, $level, objectWrapperBase::DETAIL_VELOCITY_DEFAULT, 0, $extra_fields);
     } else {
         $wrapper = objectWrapperBase::getWrapperClass($list, $level);
     }
     $this->addMsg($this->getObjectPrefix(), $wrapper);
 }
开发者ID:DBezemer,项目名称:server,代码行数:46,代码来源:listuiconfsAction.class.php

示例2: listAction

 /**
  * Retrieve a list of available UIConfs  with no partner limitation
  * 
  * @action list
  * @param KalturaUiConfFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaUiConfAdminListResponse
  */
 function listAction(KalturaUiConfFilter $filter = null, KalturaFilterPager $pager = null)
 {
     myDbHelper::$use_alternative_con = myDbHelper::DB_HELPER_CONN_PROPEL2;
     if (!$filter) {
         $filter = new KalturaUiConfFilter();
     }
     $uiConfFilter = new uiConfFilter();
     $filter->toObject($uiConfFilter);
     $c = new Criteria();
     $uiConfFilter->attachToCriteria($c);
     $count = uiConfPeer::doCount($c);
     if ($pager) {
         $pager->attachToCriteria($c);
     }
     $list = uiConfPeer::doSelect($c);
     $newList = KalturaUiConfAdminArray::fromUiConfAdminArray($list);
     $response = new KalturaUiConfAdminListResponse();
     $response->objects = $newList;
     $response->totalCount = $count;
     return $response;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:29,代码来源:UiConfAdminService.php

示例3: deprecateOldUiConfs

 /**
  *
  * Deprectes old ui confs which have the same Tags.
  * it replaces their tag from autodeploy to deprecated
  * @param string $tag - the tag to depracate
  */
 public static function deprecateOldUiConfs($tag)
 {
     //Selects all the ui confs with the given $newTag
     $con = Propel::getConnection();
     $oldConfCriteria = new Criteria();
     $oldConfCriteria->add(uiConfPeer::TAGS, "%{$tag}%", Criteria::LIKE);
     $oldConfCriteria->add(uiConfPeer::PARTNER_ID, self::$partnerId, Criteria::EQUAL);
     $oldConfCriteria->addSelectColumn(uiConfPeer::ID);
     $oldConfCriteria->addSelectColumn(uiConfPeer::TAGS);
     //Select ID, tags from ui_conf where tags like %$newTag%;
     $uiConfs = BasePeer::doSelect($oldConfCriteria, $con);
     $totalDepractedCount = 0;
     //For each uiconf:
     foreach ($uiConfs as $oldUiConf) {
         $newTag = $oldUiConf[1];
         $deprecatedTag = $newTag;
         $deprecatedTag = str_replace("autodeploy", "deprecated", $deprecatedTag);
         KalturaLog::debug("newTag is:         {$newTag} \nDeprecatedTag is : {$deprecatedTag} for partner " . self::$partnerId);
         $confCriteria = new Criteria();
         $confCriteria->add(uiConfPeer::ID, $oldUiConf[0]);
         $deprecatedConfValues = new Criteria();
         $deprecatedConfValues->add(uiConfPeer::TAGS, $deprecatedTag);
         //Update set tags = $deprecatedTag where ID = $oldUiConf->ID
         $deprecatedCount = BasePeer::doUpdate($oldConfCriteria, $deprecatedConfValues, $con);
         KalturaLog::debug("uiConf number {$oldUiConf[0]} was updated with the tag = {$deprecatedTag}");
         $totalDepractedCount += $deprecatedCount;
     }
     //Add the status check to the select factor
     KalturaLog::debug("{$totalDepractedCount} uiConfs were updated");
     $count = uiConfPeer::doCount($oldConfCriteria);
     if ($count > 0) {
         KalturaLog::debug("Exiting, Tag: {$newTag} already found in the DB");
         exit;
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:41,代码来源:deploy_v2.php

示例4: validateTemplatePartner

 /**
  * Validate the amount of core and plugin objects found on the template partner.
  * @param Partner $templatePartner
  */
 private function validateTemplatePartner(Partner $templatePartner)
 {
     //access control profiles
     $c = new Criteria();
     $c->add(accessControlPeer::PARTNER_ID, $templatePartner->getId());
     $count = accessControlPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_ac_profiles')) {
         throw new kCoreException("Template partner's number of [accessControlProfiles] objects exceed allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     //categories
     categoryPeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(categoryPeer::PARTNER_ID, $templatePartner->getId());
     $c->addAnd(categoryPeer::STATUS, CategoryStatus::ACTIVE);
     $count = categoryPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_categories')) {
         throw new kCoreException("Template partner's number of [category] objects exceed allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     categoryPeer::setUseCriteriaFilter(true);
     //conversion profiles
     $c = new Criteria();
     $c->add(conversionProfile2Peer::PARTNER_ID, $templatePartner->getId());
     $count = conversionProfile2Peer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_conversion_profiles')) {
         throw new kCoreException("Template partner's number of [conversionProfile] objects exceeds allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     //entries
     entryPeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(entryPeer::PARTNER_ID, $templatePartner->getId());
     $c->addAnd(entryPeer::TYPE, entryType::MEDIA_CLIP);
     $c->addAnd(entryPeer::STATUS, entryStatus::READY);
     $count = entryPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_entries')) {
         throw new kCoreException("Template partner's number of MEDIA_CLIP objects exceed allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     entryPeer::setUseCriteriaFilter(true);
     //playlists
     entryPeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(entryPeer::PARTNER_ID, $templatePartner->getId());
     $c->addAnd(entryPeer::TYPE, entryType::PLAYLIST);
     $c->addAnd(entryPeer::STATUS, entryStatus::READY);
     $count = entryPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_playlists')) {
         throw new kCoreException("Template partner's number of PLAYLIST objects exceed allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     entryPeer::setUseCriteriaFilter(true);
     //flavor params
     $c = new Criteria();
     $c->add(assetParamsPeer::PARTNER_ID, $templatePartner->getId());
     $count = assetParamsPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_flavor_params')) {
         throw new kCoreException("Template partner's number of [flavorParams] objects exceeds allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     //uiconfs
     uiConfPeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(uiConfPeer::PARTNER_ID, $templatePartner->getId());
     $c->addAnd(uiConfPeer::OBJ_TYPE, array(uiConf::UI_CONF_TYPE_KDP3, uiConf::UI_CONF_TYPE_WIDGET), Criteria::IN);
     $c->addAnd(uiConfPeer::STATUS, uiConf::UI_CONF_STATUS_READY);
     $count = uiConfPeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_ui_confs')) {
         throw new kCoreException("Template partner's number of [uiconf] objects exceeds allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     uiConfPeer::setUseCriteriaFilter(true);
     //user roles
     UserRolePeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(UserRolePeer::PARTNER_ID, $templatePartner->getId(), Criteria::EQUAL);
     $c->addAnd(UserRolePeer::STATUS, UserRoleStatus::ACTIVE, Criteria::EQUAL);
     $count = UserRolePeer::doCount($c);
     if ($count > kConf::get('copy_partner_limit_user_roles')) {
         throw new kCoreException("Template partner's number of [userRole] objects exceed allowed limit", kCoreException::TEMPLATE_PARTNER_COPY_LIMIT_EXCEEDED);
     }
     UserRolePeer::setUseCriteriaFilter(true);
     $validatorPlugins = KalturaPluginManager::getPluginInstances('IKalturaObjectValidator');
     foreach ($validatorPlugins as $validatorPlugins) {
         $validatorPlugins->validateObject($templatePartner, IKalturaObjectValidator::OPERATION_COPY);
     }
 }
开发者ID:AdiTal,项目名称:server,代码行数:85,代码来源:myPartnerRegistration.class.php


注:本文中的uiConfPeer::doCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。