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


PHP categoryPeer::doSelect方法代码示例

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


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

示例1: getByFullNameWildcardMatch

 /**
  * Get categories by full name using full name wildcard match (returns an array)
  *  
  * @param $partnerId
  * @param $fullName
  * @param $con
  * @return array
  */
 public static function getByFullNameWildcardMatch($fullName, $con = null)
 {
     $fullName = str_replace(array('\\', '%', '_'), array('\\\\', '\\%', '\\_'), $fullName);
     $c = new Criteria();
     $c->add(categoryPeer::FULL_NAME, $fullName . "%", Criteria::LIKE);
     return categoryPeer::doSelect($c, $con);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:15,代码来源:categoryPeer.php

示例2: getListResponse

 public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
 {
     if ($this->orderBy === null) {
         $this->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
     }
     $categoryFilter = $this->toObject();
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $categoryFilter->attachToCriteria($c);
     $pager->attachToCriteria($c);
     $dbList = categoryPeer::doSelect($c);
     $totalCount = $c->getRecordsCount();
     $list = KalturaCategoryArray::fromDbArray($dbList, $responseProfile);
     $response = new KalturaCategoryListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
开发者ID:AdiTal,项目名称:server,代码行数:17,代码来源:KalturaCategoryFilter.php

示例3: copyCategories

 public static function copyCategories(Partner $fromPartner, Partner $toPartner)
 {
     KalturaLog::log("Copying categories from partner [" . $fromPartner->getId() . "] to partner [" . $toPartner->getId() . "]");
     categoryPeer::setUseCriteriaFilter(false);
     $c = new Criteria();
     $c->addAnd(categoryPeer::PARTNER_ID, $fromPartner->getId());
     $c->addAnd(categoryPeer::STATUS, CategoryStatus::ACTIVE);
     $c->addAscendingOrderByColumn(categoryPeer::DEPTH);
     $c->addAscendingOrderByColumn(categoryPeer::CREATED_AT);
     $categories = categoryPeer::doSelect($c);
     categoryPeer::setUseCriteriaFilter(true);
     foreach ($categories as $category) {
         /* @var $category category */
         $category->setPuserId(null);
         $newCategory = $category->copy();
         $newCategory->setPartnerId($toPartner->getId());
         if ($category->getParentId()) {
             $newCategory->setParentId(kObjectCopyHandler::getMappedId('category', $category->getParentId()));
         }
         $newCategory->save();
         $newCategory->setIsIndex(true);
         categoryPeer::setUseCriteriaFilter(false);
         $newCategory->reSetFullIds();
         $newCategory->reSetInheritedParentId();
         $newCategory->reSetDepth();
         $newCategory->reSetFullName();
         categoryPeer::setUseCriteriaFilter(true);
         $newCategory->setEntriesCount(0);
         $newCategory->setMembersCount(0);
         $newCategory->setPendingMembersCount(0);
         $newCategory->setDirectSubCategoriesCount(0);
         $newCategory->setDirectEntriesCount(0);
         $newCategory->save();
         KalturaLog::log("Copied [" . $category->getId() . "], new id is [" . $newCategory->getId() . "]");
     }
 }
开发者ID:dozernz,项目名称:server,代码行数:36,代码来源:myPartnerUtils.class.php

示例4: retrieveByPKs

 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = KalturaCriteria::create(categoryPeer::OM_CLASS);
         $criteria->add(categoryPeer::ID, $pks, Criteria::IN);
         $objs = categoryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
开发者ID:AdiTal,项目名称:server,代码行数:20,代码来源:categoryPeer.php

示例5: retrieveByPKs

 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(categoryPeer::DATABASE_NAME);
         $criteria->add(categoryPeer::ID, $pks, Criteria::IN);
         $objs = categoryPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:20,代码来源:BasecategoryPeer.php

示例6: dirname

}
$countLimitEachLoop = 200;
//------------------------------------------------------
require_once dirname(__FILE__) . '/../bootstrap.php';
$con = myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2);
KalturaStatement::setDryRun($dryRun);
$lastCategoryId = 0;
while (1) {
    $c = new Criteria();
    $c->add(categoryPeer::STATUS, CategoryStatus::ACTIVE, Criteria::EQUAL);
    $c->add(categoryPeer::ID, $lastCategoryId, Criteria::GREATER_THAN);
    $c->add(categoryPeer::PRIVACY_CONTEXTS, null, Criteria::ISNOTNULL);
    $c->add(categoryPeer::PRIVACY_CONTEXTS, '', Criteria::NOT_EQUAL);
    $c->addAscendingOrderByColumn(categoryPeer::ID);
    $c->setLimit($countLimitEachLoop);
    $categories = categoryPeer::doSelect($c, $con);
    if (!count($categories)) {
        break;
    }
    foreach ($categories as $category) {
        /* @var $category category */
        KalturaLog::debug('Category [' . $category->getId() . ']');
        $lastCategoryEntryId = 0;
        while (1) {
            $c = new Criteria();
            $c->add(categoryEntryPeer::CATEGORY_ID, $category->getId(), Criteria::EQUAL);
            $c->add(categoryEntryPeer::STATUS, CategoryEntryStatus::ACTIVE, Criteria::EQUAL);
            $c->add(categoryEntryPeer::ID, $lastCategoryEntryId, Criteria::GREATER_THAN);
            $c->addAscendingOrderByColumn(categoryEntryPeer::ID);
            $c->setLimit($countLimitEachLoop);
            $categoryEntries = categoryEntryPeer::doSelect($c, $con);
开发者ID:DBezemer,项目名称:server,代码行数:31,代码来源:setCategoryEntriesPrivacyContext.php

示例7: copyEntry


//.........这里部分代码省略.........
                 foreach ($fromFiltersList as $filterXML) {
                     $entryFilter = new entryFilter();
                     $entryFilter->fillObjectFromXml($filterXML, "_");
                     if (isset($entryFilter->fields["_matchand_categories_ids"])) {
                         $categoriesIds = explode(",", $entryFilter->fields["_matchand_categories_ids"]);
                         $newCategoriesIds = array();
                         foreach ($categoriesIds as $categoryId) {
                             $newCategoriesIds[] = kObjectCopyHandler::getMappedId(categoryPeer::OM_CLASS, $categoryId);
                         }
                         $entryFilter->fields["_matchand_categories_ids"] = implode(",", $newCategoriesIds);
                     }
                     if (isset($entryFilter->fields["_matchor_categories_ids"])) {
                         $categoriesIds = explode(",", $entryFilter->fields["_matchor_categories_ids"]);
                         $newCategoriesIds = array();
                         foreach ($categoriesIds as $categoryId) {
                             $newCategoriesIds[] = kObjectCopyHandler::getMappedId(categoryPeer::OM_CLASS, $categoryId);
                         }
                         $entryFilter->fields["_matchor_categories_ids"] = implode(",", $newCategoriesIds);
                     }
                     if (isset($entryFilter->fields["_in_category_ancestor_id"])) {
                         $categoriesIds = explode(",", $entryFilter->fields["_in_category_ancestor_id"]);
                         $newCategoriesIds = array();
                         foreach ($categoriesIds as $categoryId) {
                             $newCategoriesIds[] = kObjectCopyHandler::getMappedId(categoryPeer::OM_CLASS, $categoryId);
                         }
                         $entryFilter->fields["_in_category_ancestor_id"] = implode(",", $newCategoriesIds);
                     }
                     $toEntryFilterXML = $toFiltersXml->addChild("filter");
                     $toEntryFilterXML = $entryFilter->toXml($toEntryFilterXML);
                 }
                 $newEntry->setDataContent($toPlaylistXml->asXML());
                 break;
         }
     }
     // copy relationships to categories
     KalturaLog::debug('Copy relationships to categories from entry [' . $entry->getId() . '] to entry [' . $newEntry->getId() . ']');
     $c = KalturaCriteria::create(categoryEntryPeer::OM_CLASS);
     $c->addAnd(categoryEntryPeer::ENTRY_ID, $entry->getId());
     $c->addAnd(categoryEntryPeer::STATUS, CategoryEntryStatus::ACTIVE, Criteria::EQUAL);
     $c->addAnd(categoryEntryPeer::PARTNER_ID, $entry->getPartnerId());
     categoryEntryPeer::setUseCriteriaFilter(false);
     $categoryEntries = categoryEntryPeer::doSelect($c);
     categoryEntryPeer::setUseCriteriaFilter(true);
     // Create srcCategoryIdToDstCategoryIdMap - a map of source partner category ids -> dst. partner category ids
     //
     // Build src category IDs set
     $srcCategoryIdSet = array();
     foreach ($categoryEntries as $categoryEntry) {
         $srcCategoryIdSet[] = $categoryEntry->getCategoryId();
     }
     $illegalCategoryStatus = array(CategoryStatus::DELETED, CategoryStatus::PURGED);
     // Get src category objects
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $c->add(categoryPeer::ID, $srcCategoryIdSet, Criteria::IN);
     $c->addAnd(categoryPeer::PARTNER_ID, $entry->getPartnerId());
     $c->addAnd(categoryPeer::STATUS, $illegalCategoryStatus, Criteria::NOT_IN);
     categoryPeer::setUseCriteriaFilter(false);
     $srcCategories = categoryPeer::doSelect($c);
     categoryPeer::setUseCriteriaFilter(true);
     // Map the category names to their IDs
     $fullNamesToSrcCategoryIdMap = array();
     foreach ($srcCategories as $category) {
         $fullNamesToSrcCategoryIdMap[$category->getFullName()] = $category->getId();
     }
     // Get dst. partner categories based on src. category full-names
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $c->add(categoryPeer::FULL_NAME, array_keys($fullNamesToSrcCategoryIdMap), KalturaCriteria::IN);
     $c->addAnd(categoryPeer::PARTNER_ID, $newEntry->getPartnerId());
     $c->addAnd(categoryPeer::STATUS, $illegalCategoryStatus, Criteria::NOT_IN);
     categoryPeer::setUseCriteriaFilter(false);
     $dstCategories = categoryPeer::doSelect($c);
     categoryPeer::setUseCriteriaFilter(true);
     $srcCategoryIdToDstCategoryIdMap = array();
     foreach ($dstCategories as $dstCategory) {
         $fullName = $dstCategory->getFullName();
         if (array_key_exists($fullName, $fullNamesToSrcCategoryIdMap)) {
             $srcCategoryId = $fullNamesToSrcCategoryIdMap[$fullName];
             $srcCategoryIdToDstCategoryIdMap[$srcCategoryId] = $dstCategory->getId();
         }
     }
     foreach ($categoryEntries as $categoryEntry) {
         /* @var $categoryEntry categoryEntry */
         $newCategoryEntry = $categoryEntry->copy();
         $newCategoryEntry->setPartnerId($newEntry->getPartnerId());
         $newCategoryEntry->setEntryId($newEntry->getId());
         $srcCategoryId = $categoryEntry->getCategoryId();
         if (!array_key_exists($srcCategoryId, $srcCategoryIdToDstCategoryIdMap)) {
             continue;
             // Skip the category_entry's creation
         }
         $dstCategoryId = $srcCategoryIdToDstCategoryIdMap[$srcCategoryId];
         $newCategoryEntry->setCategoryId($dstCategoryId);
         categoryPeer::setUseCriteriaFilter(false);
         entryPeer::setUseCriteriaFilter(false);
         $newCategoryEntry->save();
         entryPeer::setUseCriteriaFilter(true);
         categoryPeer::setUseCriteriaFilter(true);
     }
     return $newEntry;
 }
开发者ID:DBezemer,项目名称:server,代码行数:101,代码来源:myEntryUtils.class.php

示例8: while

if ($limit) {
    $criteria->setLimit(min($page, $limit));
} else {
    $criteria->setLimit($page);
}
$entries = entryPeer::doSelect($criteria);
$migrated = 0;
while (count($entries) && (!$limit || $migrated < $limit)) {
    KalturaLog::info("Migrating [" . count($entries) . "] entries.");
    $migrated += count($entries);
    $lastIntId = null;
    foreach ($entries as $entry) {
        /* @var $entry entry */
        $categoriesCriteria = new Criteria();
        $categoriesCriteria->add(categoryPeer::ID, $entry->getCategoriesIds(), Criteria::IN);
        $categories = categoryPeer::doSelect($categoriesCriteria);
        $categoryIds = array();
        foreach ($categories as $category) {
            /* @var $category category */
            $categoryIds[] = $category->getId();
        }
        $categoryEntriesCriteria = new Criteria();
        $categoryEntriesCriteria->addSelectColumn(categoryEntryPeer::CATEGORY_ID);
        $categoryEntriesCriteria->add(categoryEntryPeer::ENTRY_ID, $entry->getId());
        $categoryEntriesCriteria->add(categoryEntryPeer::CATEGORY_ID, $categoryIds, Criteria::IN);
        $stmt = categoryEntryPeer::doSelectStmt($categoryEntriesCriteria);
        $categoryEntriesIds = $stmt->fetchAll(PDO::FETCH_COLUMN);
        KalturaStatement::setDryRun($dryRun);
        foreach ($categories as $category) {
            /* @var $category category */
            $entryId = $entry->getId();
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:31,代码来源:migrateEntryCategories.php

示例9: getAllChildren

 /**
  * @return array
  */
 public function getAllChildren()
 {
     $c = new Criteria();
     $c->add(categoryPeer::FULL_NAME, $this->getFullName() . '%', Criteria::LIKE);
     $c->addAnd(categoryPeer::PARTNER_ID, $this->getPartnerId(), Criteria::EQUAL);
     KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     $categories = categoryPeer::doSelect($c);
     KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     return $categories;
 }
开发者ID:dozernz,项目名称:server,代码行数:13,代码来源:category.php

示例10: listAction

 /**
  * List all categories
  * 
  * @action list
  * @return KalturaCategoryListResponse
  */
 function listAction(KalturaCategoryFilter $filter = null)
 {
     if ($filter === null) {
         $filter = new KalturaCategoryFilter();
     }
     if ($filter->orderBy === null) {
         $filter->orderBy = KalturaCategoryOrderBy::DEPTH_ASC;
     }
     $categoryFilter = new categoryFilter();
     $filter->toObject($categoryFilter);
     $c = new Criteria();
     $categoryFilter->attachToCriteria($c);
     $totalCount = categoryPeer::doCount($c);
     $dbList = categoryPeer::doSelect($c);
     $list = KalturaCategoryArray::fromCategoryArray($dbList);
     $response = new KalturaCategoryListResponse();
     $response->objects = $list;
     $response->totalCount = $totalCount;
     return $response;
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:26,代码来源:CategoryService.php

示例11: getPrivacyContextForEntry

 public static function getPrivacyContextForEntry(entry $entry)
 {
     $privacyContexts = array();
     $entryPrivacy = null;
     $categories = array();
     if (count($entry->getAllCategoriesIds(true))) {
         $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
         KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
         $c->add(categoryPeer::ID, $entry->getAllCategoriesIds(true), Criteria::IN);
         KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
         KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
         $categories = categoryPeer::doSelect($c);
         KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
         foreach ($categories as $category) {
             $categoryPrivacy = $category->getPrivacy();
             $categoryPrivacyContexts = $category->getPrivacyContexts();
             if (!$categoryPrivacyContexts) {
                 $categoryPrivacyContexts = self::DEFAULT_CONTEXT . $entry->getPartnerId();
             }
             $categoryPrivacyContexts = explode(',', $categoryPrivacyContexts);
             foreach ($categoryPrivacyContexts as $categoryPrivacyContext) {
                 if (trim($categoryPrivacyContext) == '') {
                     $categoryPrivacyContext = self::DEFAULT_CONTEXT . $entry->getPartnerId();
                 }
                 if (!isset($privacyContexts[$categoryPrivacyContext]) || $privacyContexts[$categoryPrivacyContext] > $categoryPrivacy) {
                     $privacyContexts[trim($categoryPrivacyContext)] = $categoryPrivacy;
                 }
             }
         }
     }
     //Entry That doesn't assinged to any category is public.
     if (!count($categories)) {
         $privacyContexts[self::DEFAULT_CONTEXT . $entry->getPartnerId()] = PrivacyType::ALL;
     }
     $entryPrivacyContexts = array();
     foreach ($privacyContexts as $categoryPrivacyContext => $Privacy) {
         $entryPrivacyContexts[] = $categoryPrivacyContext . '_' . $Privacy;
     }
     KalturaLog::debug('Privacy by context: ' . print_r($entryPrivacyContexts, true));
     return $entryPrivacyContexts;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:41,代码来源:kEntitlementUtils.php

示例12: copyEntry


//.........这里部分代码省略.........
     }
     $from = $entry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
     // replaced__getThumbnailPath
     $considerCopyThumb = true;
     // if entry is image - data is thumbnail, and it was copied
     if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
         $considerCopyThumb = false;
     }
     // if entry is not clip, and there is no file in both DCs - nothing to copy
     if ($entry->getType() != entryType::MEDIA_CLIP && !kFileSyncUtils::file_exists($from, true)) {
         $considerCopyThumb = false;
     }
     if ($considerCopyThumb) {
         $skipThumb = false;
         // don't attempt to copy a thumbnail for images - it's the same as the data which was just created
         if ($entry->getMediaType() == entry::ENTRY_MEDIA_TYPE_AUDIO) {
             // check if audio entry has real thumb, if not - don't copy thumb.
             $originalFileSync = kFileSyncUtils::getOriginFileSyncForKey($from, false);
             if (!$originalFileSync) {
                 $skipThumb = true;
             }
         }
         if (!$skipThumb) {
             $to = $newEntry->getSyncKey(entry::FILE_SYNC_ENTRY_SUB_TYPE_THUMB);
             // replaced__getThumbnailPath
             KalturaLog::log("copyEntriesByType - copying entry thumbnail [" . $from . "] to [" . $to . "]");
             kFileSyncUtils::softCopy($from, $to);
         }
     }
     // added by Tan-Tan 12/01/2010 to support falvors copy
     $sourceAssets = assetPeer::retrieveByEntryId($entry->getId());
     foreach ($sourceAssets as $sourceAsset) {
         $sourceAsset->copyToEntry($newEntry->getId(), $newEntry->getPartnerId());
     }
     // copy relationships to categories
     KalturaLog::debug('Copy relationships to categories from entry [' . $entry->getId() . '] to entry [' . $newEntry->getId() . ']');
     $c = KalturaCriteria::create(categoryEntryPeer::OM_CLASS);
     $c->addAnd(categoryEntryPeer::ENTRY_ID, $entry->getId());
     $c->addAnd(categoryEntryPeer::STATUS, CategoryEntryStatus::ACTIVE, Criteria::EQUAL);
     $c->addAnd(categoryEntryPeer::PARTNER_ID, $entry->getPartnerId());
     categoryEntryPeer::setUseCriteriaFilter(false);
     $categoryEntries = categoryEntryPeer::doSelect($c);
     categoryEntryPeer::setUseCriteriaFilter(true);
     // Create srcCategoryIdToDstCategoryIdMap - a map of source partner category ids -> dst. partner category ids
     //
     // Build src category IDs set
     $srcCategoryIdSet = array();
     foreach ($categoryEntries as $categoryEntry) {
         $srcCategoryIdSet[] = $categoryEntry->getCategoryId();
     }
     $illegalCategoryStatus = array(CategoryStatus::DELETED, CategoryStatus::PURGED);
     // Get src category objects
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $c->add(categoryPeer::ID, $srcCategoryIdSet, Criteria::IN);
     $c->addAnd(categoryPeer::PARTNER_ID, $entry->getPartnerId());
     $c->addAnd(categoryPeer::STATUS, $illegalCategoryStatus, Criteria::NOT_IN);
     categoryPeer::setUseCriteriaFilter(false);
     $srcCategories = categoryPeer::doSelect($c);
     categoryPeer::setUseCriteriaFilter(true);
     // Map the category names to their IDs
     $fullNamesToSrcCategoryIdMap = array();
     foreach ($srcCategories as $category) {
         $fullNamesToSrcCategoryIdMap[$category->getFullName()] = $category->getId();
     }
     // Get dst. partner categories based on src. category full-names
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $c->add(categoryPeer::FULL_NAME, array_keys($fullNamesToSrcCategoryIdMap), KalturaCriteria::IN);
     $c->addAnd(categoryPeer::PARTNER_ID, $newEntry->getPartnerId());
     $c->addAnd(categoryPeer::STATUS, $illegalCategoryStatus, Criteria::NOT_IN);
     categoryPeer::setUseCriteriaFilter(false);
     $dstCategories = categoryPeer::doSelect($c);
     categoryPeer::setUseCriteriaFilter(true);
     $srcCategoryIdToDstCategoryIdMap = array();
     foreach ($dstCategories as $dstCategory) {
         $fullName = $dstCategory->getFullName();
         if (array_key_exists($fullName, $fullNamesToSrcCategoryIdMap)) {
             $srcCategoryId = $fullNamesToSrcCategoryIdMap[$fullName];
             $srcCategoryIdToDstCategoryIdMap[$srcCategoryId] = $dstCategory->getId();
         }
     }
     foreach ($categoryEntries as $categoryEntry) {
         /* @var $categoryEntry categoryEntry */
         $newCategoryEntry = $categoryEntry->copy();
         $newCategoryEntry->setPartnerId($newEntry->getPartnerId());
         $newCategoryEntry->setEntryId($newEntry->getId());
         $srcCategoryId = $categoryEntry->getCategoryId();
         if (!array_key_exists($srcCategoryId, $srcCategoryIdToDstCategoryIdMap)) {
             continue;
             // Skip the category_entry's creation
         }
         $dstCategoryId = $srcCategoryIdToDstCategoryIdMap[$srcCategoryId];
         $newCategoryEntry->setCategoryId($dstCategoryId);
         categoryPeer::setUseCriteriaFilter(false);
         entryPeer::setUseCriteriaFilter(false);
         $newCategoryEntry->save();
         entryPeer::setUseCriteriaFilter(true);
         categoryPeer::setUseCriteriaFilter(true);
     }
     return $newEntry;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:101,代码来源:myEntryUtils.class.php

示例13: getCategoriesByIds

 private static function getCategoriesByIds($categoriesIds)
 {
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     $c->add(categoryPeer::ID, $categoriesIds, Criteria::IN);
     KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     $c->dontCount();
     KalturaCriterion::disableTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     $categories = categoryPeer::doSelect($c);
     KalturaCriterion::restoreTag(KalturaCriterion::TAG_ENTITLEMENT_CATEGORY);
     return $categories;
 }
开发者ID:kubrickfr,项目名称:server,代码行数:12,代码来源:kEntitlementUtils.php

示例14: getChilds

 /**
  * @return array
  */
 public function getChilds()
 {
     if ($this->isNew()) {
         return array();
     }
     $c = new Criteria();
     $c->add(categoryPeer::PARENT_ID, $this->getId());
     return categoryPeer::doSelect($c);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:12,代码来源:category.php

示例15: ini_set

ini_set("memory_limit", "256M");
require_once __DIR__ . '/bootstrap.php';
if (!count($argv)) {
    die("No partner_id passed to script!");
}
$partnerId = $argv[1];
var_dump($partnerId);
if (!PartnerPeer::retrieveByPK($partnerId)) {
    die("Please enter a valid partner Id!");
}
$criteria = new Criteria();
$criteria->add(categoryPeer::PARTNER_ID, $partnerId, Criteria::EQUAL);
$criteria->setLimit(1000);
$allCats = categoryPeer::doSelect($criteria);
while (count($allCats)) {
    foreach ($allCats as $categoryDb) {
        /* @var $categoryDb category */
        $categoryDb->reSetEntriesCount();
        $categoryDb->reSetDirectSubCategoriesCount();
        $categoryDb->reSetDirectEntriesCount();
        $categoryDb->reSetPendingEntriesCount();
        $categoryDb->reSetPendingMembersCount();
        $categoryDb->save();
    }
    $criteria->setOffset($criteria->getOffset() + count($allCats));
    kMemoryManager::clearMemory();
    usleep(200);
    $allCats = categoryPeer::doSelect($criteria);
}
KalturaLog::log('Done.');
开发者ID:DBezemer,项目名称:server,代码行数:30,代码来源:categoryCount.php


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