本文整理匯總了PHP中FileSyncPeer::doCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileSyncPeer::doCount方法的具體用法?PHP FileSyncPeer::doCount怎麽用?PHP FileSyncPeer::doCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileSyncPeer
的用法示例。
在下文中一共展示了FileSyncPeer::doCount方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: listAction
/**
* List file syce objects by filter and pager
*
* @action list
* @param KalturaFileSyncFilter $filter
* @param KalturaFilterPager $pager
* @return KalturaFileSyncListResponse
*/
function listAction(KalturaFileSyncFilter $filter = null, KalturaFilterPager $pager = null)
{
if (!$filter) {
$filter = new KalturaFileSyncFilter();
}
if (!$pager) {
$pager = new KalturaFilterPager();
}
$fileSyncFilter = new FileSyncFilter();
$filter->toObject($fileSyncFilter);
$c = new Criteria();
$fileSyncFilter->attachToCriteria($c);
$totalCount = FileSyncPeer::doCount($c);
$pager->attachToCriteria($c);
$dbList = FileSyncPeer::doSelect($c);
$list = KalturaFileSyncArray::fromDbArray($dbList, $this->getResponseProfile());
$response = new KalturaFileSyncListResponse();
$response->objects = $list;
$response->totalCount = $totalCount;
return $response;
}
示例2: foreach
$criteria->add(FileSyncPeer::LINKED_ID, $fileSync->getId());
$links = FileSyncPeer::doSelect($criteria);
foreach ($links as $link) {
deleteObject($link);
}
}
KalturaStatement::setDryRun($dryRun);
$criteria = new Criteria();
$criteria->add(FileSyncPeer::STATUS, FileSync::FILE_SYNC_STATUS_READY);
$criteria->add(FileSyncPeer::FILE_TYPE, FileSync::FILE_SYNC_FILE_TYPE_FILE);
$criteria->add(FileSyncPeer::OBJECT_TYPE, $objectType);
$criteria->add(FileSyncPeer::DC, $dc);
if ($startId) {
$criteria->add(FileSyncPeer::ID, $startId, Criteria::GREATER_THAN);
}
$fileSyncsCount = FileSyncPeer::doCount($criteria);
KalturaLog::debug("Found [{$fileSyncsCount}] file syncs");
$criteria->addAscendingOrderByColumn(FileSyncPeer::ID);
$criteria->setLimit(500);
$lastId = 0;
$index = 0;
$fileSyncs = FileSyncPeer::doSelect($criteria);
while (count($fileSyncs)) {
foreach ($fileSyncs as $fileSync) {
/* @var $fileSync FileSync */
$index++;
$lastId = $fileSync->getId();
if (!file_exists($fileSync->getFullPath())) {
deleteObject($fileSync);
}
KalturaLog::debug("Handled [{$index}/{$fileSyncsCount}]");