本文整理汇总了PHP中KalturaCriteria::addOr方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaCriteria::addOr方法的具体用法?PHP KalturaCriteria::addOr怎么用?PHP KalturaCriteria::addOr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaCriteria
的用法示例。
在下文中一共展示了KalturaCriteria::addOr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copyCuePointsToClipEntry
/**
*
* @param entry $clipEntry new entry to copy and adjust cue points from root entry to
*/
public static function copyCuePointsToClipEntry(entry $clipEntry)
{
$clipAtts = self::getClipAttributesFromEntry($clipEntry);
if (!is_null($clipAtts)) {
$sourceEntry = entryPeer::retrieveByPK($clipEntry->getSourceEntryId());
if (is_null($sourceEntry)) {
KalturaLog::info("Didn't copy cuePoints for entry [{$clipEntry->getId()}] because source entry [" . $clipEntry->getSourceEntryId() . "] wasn't found");
return;
}
$sourceEntryDuration = $sourceEntry->getLengthInMsecs();
$clipStartTime = $clipAtts->getOffset();
if (is_null($clipStartTime)) {
$clipStartTime = 0;
}
$clipDuration = $clipAtts->getDuration();
if (is_null($clipDuration)) {
$clipDuration = $sourceEntryDuration;
}
$c = new KalturaCriteria();
$c->add(CuePointPeer::ENTRY_ID, $clipEntry->getSourceEntryId());
if ($clipDuration < $sourceEntryDuration) {
$c->addAnd(CuePointPeer::START_TIME, $clipStartTime + $clipDuration, KalturaCriteria::LESS_EQUAL);
}
if ($clipStartTime > 0) {
$c->addAnd(CuePointPeer::START_TIME, $clipStartTime, KalturaCriteria::GREATER_EQUAL);
$c->addOr(CuePointPeer::START_TIME, 0, KalturaCriteria::EQUAL);
}
$c->addAscendingOrderByColumn(CuePointPeer::CREATED_AT);
$rootEntryCuePointsToCopy = CuePointPeer::doSelect($c);
if (count($rootEntryCuePointsToCopy) <= self::MAX_CUE_POINTS_TO_COPY_TO_CLIP) {
foreach ($rootEntryCuePointsToCopy as $cuePoint) {
$cuePoint->copyToClipEntry($clipEntry, $clipStartTime, $clipDuration);
}
} else {
KalturaLog::alert("Can't copy cuePoints for entry [{$clipEntry->getId()}] because cuePoints count exceeded max limit of [" . self::MAX_CUE_POINTS_TO_COPY_TO_CLIP . "]");
}
}
}