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


PHP myCriteria::addComment方法代码示例

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


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

示例1: addPartnerToCriteria

 public static function addPartnerToCriteria($partnerId, $privatePartnerData = false, $partnerGroup = null, $kalturaNetwork = null)
 {
     self::$filterPartner = $partnerId;
     if (!self::$isDefaultInDefaultCriteria) {
         return parent::addPartnerToCriteria($partnerId, $privatePartnerData, $partnerGroup, $kalturaNetwork);
     }
     $criteriaFilter = self::getCriteriaFilter();
     $criteria = $criteriaFilter->getFilter();
     if (!$privatePartnerData) {
         // the private partner data is not allowed -
         if ($kalturaNetwork) {
             // allow only the kaltura network stuff
             if ($partnerId) {
                 $orderBy = "(" . self::PARTNER_ID . "<>{$partnerId})";
                 // first take the pattner_id and then the rest
                 myCriteria::addComment($criteria, "Only Kaltura Network");
                 $criteria->addAscendingOrderByColumn($orderBy);
                 //, Criteria::CUSTOM );
             }
         } else {
             // no private data and no kaltura_network -
             // add a criteria that will return nothing
             $criteria->addAnd(self::PARTNER_ID, Partner::PARTNER_THAT_DOWS_NOT_EXIST);
         }
     } else {
         // private data is allowed
         if (empty($partnerGroup) && empty($kalturaNetwork)) {
             // the default case
             $criteria->addAnd(self::PARTNER_ID, $partnerId);
         } elseif ($partnerGroup == myPartnerUtils::ALL_PARTNERS_WILD_CHAR) {
             // all is allowed - don't add anything to the criteria
         } else {
             $criterion = null;
             if ($partnerGroup) {
                 // $partnerGroup hold a list of partners separated by ',' or $kalturaNetwork is not empty (should be mySearchUtils::KALTURA_NETWORK = 'kn')
                 $partners = explode(',', trim($partnerGroup));
                 $hasPartnerZero = false;
                 foreach ($partners as $index => &$p) {
                     trim($p);
                     // make sure there are not leading or trailing spaces
                     if ($p == 0) {
                         unset($partners[$index]);
                         $hasPartnerZero = true;
                     }
                 }
                 // add the partner_id to the partner_group
                 $partners[] = strval($partnerId);
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partners, Criteria::IN);
                 if ($hasPartnerZero) {
                     $query = "(" . self::PARTNER_ID . " = 0 AND " . self::IS_DEFAULT . " = 1)";
                     $criterion->addOr($criteria->getNewCriterion(self::PARTNER_ID, $query, Criteria::CUSTOM));
                 }
             } else {
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partnerId);
             }
             $criteria->addAnd($criterion);
         }
     }
     $criteriaFilter->enable();
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:60,代码来源:assetParamsPeer.php

示例2: addPartnerToCriteria

 public static function addPartnerToCriteria($partnerId, $privatePartnerData = false, $partnerGroup = null, $kalturaNetwork = null)
 {
     $criteriaFilter = self::getCriteriaFilter();
     $criteria = $criteriaFilter->getFilter();
     if (!$privatePartnerData) {
         // the private partner data is not allowed -
         if ($kalturaNetwork) {
             // allow only the kaltura network stuff
             $criteria->addAnd(self::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
             if ($partnerId) {
                 $orderBy = "(" . self::PARTNER_ID . "<>{$partnerId})";
                 // first take the pattner_id and then the rest
                 myCriteria::addComment($criteria, "Only Kaltura Network");
                 $criteria->addAscendingOrderByColumn($orderBy);
                 //, Criteria::CUSTOM );
             }
         } else {
             // no private data and no kaltura_network -
             // add a criteria that will return nothing
             $criteria->addAnd(self::PARTNER_ID, Partner::PARTNER_THAT_DOWS_NOT_EXIST);
         }
     } else {
         $criterion = null;
         // private data is allowed
         if (!strlen(strval($partnerGroup))) {
             // the default case
             $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partnerId);
             $criteria->addAnd($criterion);
         } elseif ($partnerGroup == myPartnerUtils::ALL_PARTNERS_WILD_CHAR) {
             // all is allowed - don't add anything to the criteria
         } else {
             // $partnerGroup hold a list of partners separated by ',' or $kalturaNetwork is not empty (should be mySearchUtils::KALTURA_NETWORK = 'kn')
             $partners = explode(',', trim($partnerGroup));
             foreach ($partners as &$p) {
                 trim($p);
             }
             // make sure there are not leading or trailing spaces
             // add the partner_id to the partner_group
             if (!in_array(strval($partnerId), $partners)) {
                 $partners[] = strval($partnerId);
             }
             if (count($partners) == 1 && reset($partners) == $partnerId) {
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partnerId);
                 $criteria->addAnd($criterion);
             } else {
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partners, Criteria::IN);
                 if ($kalturaNetwork) {
                     $criterionNetwork = $criteria->getNewCriterion(self::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
                     $criterion->addOr($criterionNetwork);
                 }
                 $criteria->addAnd($criterion);
             }
         }
         if ($criterion && $criterion instanceof KalturaCriterion) {
             $criterion->addTag(KalturaCriterion::TAG_PARTNER_SESSION);
         }
     }
     $criteriaFilter->enable();
 }
开发者ID:AdiTal,项目名称:server,代码行数:59,代码来源:categoryPeer.php

示例3: retrieveByPartnerAndUid

 public static function retrieveByPartnerAndUid($partner_id, $subp_id, $puser_id, $join_kuser = false)
 {
     $c = new Criteria();
     myCriteria::addComment($c, "PuserKuserPeer::retrieveByPartnerAndUid");
     $c->add(self::PARTNER_ID, $partner_id);
     if ($subp_id) {
         $c->add(self::SUBP_ID, $subp_id);
     }
     $c->add(self::PUSER_ID, $puser_id);
     if ($join_kuser) {
         $puser_kusers = self::doSelectJoinkuser($c);
     } else {
         $puser_kusers = self::doSelect($c);
     }
     if (count($puser_kusers) > 0) {
         $puser_kuser = $puser_kusers[0];
     } else {
         $puser_kuser = null;
     }
     return $puser_kuser;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:21,代码来源:PuserKuserPeer.php

示例4: getDefaultKshow

 /**
  * Will search for a kshow for the specific partner & key.
  * The key can be combined from the kuser_id and the group_id
  * If not found - will create one
  * If both the kuser_id & group_id are null - always create one
  */
 public static function getDefaultKshow($partner_id, $subp_id, $puser_kuser, $group_id = null, $allow_quick_edit = null, $create_anyway = false, $default_name = null)
 {
     $kuser_id = null;
     // make sure puser_kuser object exists so function will not exit with FATAL
     if ($puser_kuser) {
         $kuser_id = $puser_kuser->getKuserId();
     }
     $key = $group_id != null ? $group_id : $kuser_id;
     if (!$create_anyway) {
         $c = new Criteria();
         myCriteria::addComment($c, "myKshowUtils::getDefaultKshow");
         $c->add(kshowPeer::GROUP_ID, $key);
         $kshow = kshowPeer::doSelectOne($c);
         if ($kshow) {
             return $kshow;
         }
         // no kshow - create using the service
         $name = "{$key}'s generated show'";
     } else {
         $name = "a generated show'";
     }
     if ($default_name) {
         $name = $default_name;
     }
     $extra_params = array("kshow_groupId" => $key, "kshow_allowQuickEdit" => $allow_quick_edit);
     // set the groupId with the key so we'll find it next time round
     $kshow = myPartnerServicesClient::createKshow("", $puser_kuser->getPuserId(), $name, $partner_id, $subp_id, $extra_params);
     return $kshow;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:35,代码来源:myKshowUtils.class.php

示例5: executeImpl

 public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser)
 {
     //		$this->applyPartnerFilterForClass( new ConversionProfilePeer() , $partner_id );
     // TODO -  verify permissions for viewing lists
     $detailed = $this->getP("detailed", false);
     $limit = $this->getP("page_size", 10);
     $page = $this->getP("page", 1);
     //$order_by = int( $this->getP ( "order_by" , -1 ) );
     $offset = ($page - 1) * $limit;
     $partner_current_conversion_profile = myPartnerUtils::getCurrentConversionProfile($partner_id);
     $c = new Criteria();
     // filter
     $filter = new ConversionProfileFilter();
     $fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null);
     $filter->set("_order_by", null);
     // ignore the order_by for now
     $filter->attachToCriteria($c);
     // partner_id either the partner or partner_id=0
     $crit = $c->getNewCriterion(ConversionProfilePeer::PARTNER_ID, 0);
     $c->addAnd($crit->addOr($c->getNewCriterion(ConversionProfilePeer::PARTNER_ID, $partner_id)));
     // for now - only enabled profiles
     $c->addAnd(ConversionProfilePeer::ENABLED, 1);
     // make sure the partner's profiles will appear first ordered by id desc - last will come first
     $order_by = "(" . ConversionProfilePeer::PARTNER_ID . "<>{$partner_id})";
     // first take the patner_id and then the rest
     myCriteria::addComment($c, "Only Kaltura Network");
     $c->addAscendingOrderByColumn($order_by);
     //, Criteria::CUSTOM );
     $c->addDescendingOrderByColumn(ConversionProfilePeer::UPDATED_AT);
     //, Criteria::CUSTOM );
     $c->addDescendingOrderByColumn(ConversionProfilePeer::ID);
     //, Criteria::CUSTOM );
     //if ($order_by != -1) kshowPeer::setOrder( $c , $order_by );
     $count = ConversionProfilePeer::doCount($c);
     $offset = ($page - 1) * $limit;
     $c->setLimit($limit);
     if ($offset > 0) {
         $c->setOffset($offset);
     }
     $list = ConversionProfilePeer::doSelect($c);
     if (count($list) > 0) {
         // reorder the list so the first will always be the best default  for the partner
         $partner_list = array($partner_current_conversion_profile);
         // the first is always the partner's default
         //			$this->addDebug( "partner_current_conversion_profile" , objectWrapperBase::getWrapperClass( $partner_current_conversion_profile ) );
         $global_list = array();
         $default_prof = array();
         foreach ($list as $conv_profile) {
             if ($conv_profile->getPartnerId() == ConversionProfile::GLOBAL_PARTNER_PROFILE) {
                 if ($conv_profile->getProfileType() == ConversionProfile::DEFAULT_COVERSION_PROFILE_TYPE) {
                     $default_prof[] = $conv_profile;
                 } else {
                     $global_list[] = $conv_profile;
                 }
             } elseif ($conv_profile->getPartnerId() == $partner_id) {
                 $partner_list[] = $conv_profile;
             }
         }
         //			$level = objectWrapperBase::DETAIL_LEVEL_REGULAR ;
         //			$this->addMsg ( "par-list" , objectWrapperBase::getWrapperClass( $partner_list  , $level ) ) ;
         //			$this->addMsg ( "def-list" , objectWrapperBase::getWrapperClass( $default_prof  , $level ) ) ;
         //			$this->addMsg ( "rest-list" , objectWrapperBase::getWrapperClass( $global_list  , $level ) ) ;
         // this is the correct order - the partners , the default and all the rest of the globals
         $list = array_merge($partner_list, $default_prof, $global_list);
     }
     $level = objectWrapperBase::DETAIL_LEVEL_REGULAR;
     $this->addMsg("count", $count);
     $this->addMsg("page_size", $limit);
     $this->addMsg("page", $page);
     $wrapper = objectWrapperBase::getWrapperClass($list, $level);
     $this->addMsg("conversionProfiles", $wrapper);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:72,代码来源:listconversionprofilesAction.class.php

示例6: addPartnerToCriteria

 public static function addPartnerToCriteria($partnerId, $privatePartnerData = false, $partnerGroup = null, $kalturaNetwork = null)
 {
     $criteriaFilter = self::getCriteriaFilter();
     $criteria = $criteriaFilter->getFilter();
     if (!$privatePartnerData) {
         // the private partner data is not allowed -
         if ($kalturaNetwork) {
             // allow only the kaltura netword stuff
             $criteria->addAnd(self::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
             if ($partnerId) {
                 $orderBy = "(" . self::PARTNER_ID . "<>{$partnerId})";
                 // first take the pattner_id and then the rest
                 myCriteria::addComment($criteria, "Only Kaltura Network");
                 $criteria->addAscendingOrderByColumn($orderBy);
                 //, Criteria::CUSTOM );
             }
         } else {
             // no private data and no kaltura_network -
             // add a criteria that will return nothing
             $criteria->addAnd(self::PARTNER_ID, Partner::PARTNER_THAT_DOWS_NOT_EXIST);
         }
     } else {
         // private data is allowed
         if (empty($partnerGroup) && empty($kalturaNetwork)) {
             // the default case
             $criteria->addAnd(self::PARTNER_ID, $partnerId);
         } elseif ($partnerGroup == myPartnerUtils::ALL_PARTNERS_WILD_CHAR) {
             // all is allowed - don't add anything to the criteria
         } else {
             $criterion = null;
             if ($partnerGroup) {
                 // $partnerGroup hold a list of partners separated by ',' or $kalturaNetwork is not empty (should be mySearchUtils::KALTURA_NETWORK = 'kn')
                 $partners = explode(',', trim($partnerGroup));
                 foreach ($partners as &$p) {
                     trim($p);
                 }
                 // make sure there are not leading or trailing spaces
                 // add the partner_id to the partner_group
                 if (!in_array($partnerId, $partners)) {
                     // NOTE: we need to add the partner as a string since we want all
                     // the PATNER_ID IN () values to be of the same type.
                     // otherwise mysql will fail choosing the right index and will
                     // do a full table scan
                     $partners[] = "" . $partnerId;
                 }
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partners, Criteria::IN);
             } else {
                 $criterion = $criteria->getNewCriterion(self::PARTNER_ID, $partnerId);
             }
             if ($kalturaNetwork) {
                 $criterionNetwork = $criteria->getNewCriterion(self::DISPLAY_IN_SEARCH, mySearchUtils::DISPLAY_IN_SEARCH_KALTURA_NETWORK);
                 $criterion->addOr($criterionNetwork);
             }
             $criteria->addAnd($criterion);
         }
     }
     $criteriaFilter->enable();
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:58,代码来源:BaseuiConfPeer.php

示例7: deleteEntry

 public static function deleteEntry(entry $entry)
 {
     $kshow = $entry->getkshow();
     if ($kshow) {
         $v = $kshow->getEntries();
         self::dec($v);
         $kshow->setEntries($v);
         $c = new Criteria();
         myCriteria::addComment($c, __METHOD__);
         $c->add(entryPeer::KSHOW_ID, $entry->getKshowId());
         $c->add(entryPeer::KUSER_ID, $entry->getKuserId());
         $c->setLimit(2);
         $res = entryPeer::doCount($c);
         if ($res == 1) {
             // if $res > 1 -  this kuser contributed more than one entry, deleting this one should still leave him a contributor
             // if $res < 1 -  this kuser never contributed - strange! but no need to dec the contributors
             // kuser did contribute to this kshow - decrement
             $v = $kshow->getContributors();
             self::dec($v);
             $kshow->setContributors($v);
         }
         $kuser = $entry->getkuser();
         if ($kuser) {
             $v = $kuser->getEntries();
             self::dec($v);
             $kuser->setEntries($v);
         }
         self::add($kshow);
         self::add($kuser);
     }
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:31,代码来源:myStatisticsMgr.class.php


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