本文整理汇总了PHP中KalturaCriteria::add方法的典型用法代码示例。如果您正苦于以下问题:PHP KalturaCriteria::add方法的具体用法?PHP KalturaCriteria::add怎么用?PHP KalturaCriteria::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KalturaCriteria
的用法示例。
在下文中一共展示了KalturaCriteria::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchNextPage
private function fetchNextPage()
{
$this->entriesCurrentPage = null;
$this->clearMemory();
if ($this->currentCriteria) {
if ($this->lastEntryIntId && $this->lastEntryCreatedAt) {
$this->currentCriteria->add(entryPeer::INT_ID, $this->lastEntryIntId, Criteria::LESS_THAN);
$this->currentCriteria->add(entryPeer::CREATED_AT, $this->lastEntryCreatedAt, Criteria::LESS_EQUAL);
}
} else {
$this->currentCriteria = $this->getNextCriteria();
if (!$this->currentCriteria) {
return;
}
}
$nextPage = entryPeer::doSelect($this->currentCriteria);
if (!count($nextPage)) {
$this->currentCriteria = $this->getNextCriteria();
if (!$this->currentCriteria) {
return;
}
$nextPage = entryPeer::doSelect($this->currentCriteria);
}
if (!count($nextPage)) {
// finished all criterias and pages
return;
}
$this->entriesCurrentPage = $nextPage;
}
示例2: fetchNextPage
private function fetchNextPage()
{
if ($this->executed && $this->staticPlaylist) {
return;
}
$this->entriesCurrentPage = null;
kMemoryManager::clearMemory();
if ($this->currentCriteria) {
if ($this->lastEntryCreatedAt) {
$this->currentCriteria->add($this->getOrderByColumn(), $this->lastEntryCreatedAt, Criteria::LESS_EQUAL);
}
if (count($this->lastEntryIds)) {
$this->currentCriteria->add(entryPeer::ID, $this->lastEntryIds, Criteria::NOT_IN);
}
} else {
$this->currentCriteria = $this->getNextCriteria();
if (!$this->currentCriteria) {
return;
}
}
$nextPage = entryPeer::doSelect($this->currentCriteria);
if (!count($nextPage)) {
$this->currentCriteria = $this->getNextCriteria();
if (!$this->currentCriteria) {
return;
}
$nextPage = entryPeer::doSelect($this->currentCriteria);
}
if (!count($nextPage)) {
// finished all criterias and pages
return;
}
if ($this->staticPlaylist) {
//order the entries by static (AKA manual) entries order
$nextPageEntries = array();
foreach ($nextPage as $entry) {
$nextPageEntries[$entry->getId()] = $entry;
}
$nextPage = array();
foreach ($this->staticPlaylistEntriesIdsOrder as $entryId) {
if (isset($nextPageEntries[$entryId])) {
$nextPage[] = $nextPageEntries[$entryId];
}
}
}
$this->entriesCurrentPage = $nextPage;
reset($this->entriesCurrentPage);
}
示例3: 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 . "]");
}
}
}
示例4: add
public function add($p1, $value = null, $comparison = null)
{
if ($p1 instanceof Criterion) {
$oc = $this->getCriterion($p1->getColumn());
if (!is_null($oc) && $oc->getValue() == $p1->getValue() && $oc->getComparison() != $p1->getComparison()) {
return $this;
}
return parent::add($p1);
}
$nc = new SolrEntryCriterion($this, $p1, $value, $comparison);
return parent::add($nc);
}