本文整理汇总了PHP中BatchJobPeer::setUseCriteriaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP BatchJobPeer::setUseCriteriaFilter方法的具体用法?PHP BatchJobPeer::setUseCriteriaFilter怎么用?PHP BatchJobPeer::setUseCriteriaFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BatchJobPeer
的用法示例。
在下文中一共展示了BatchJobPeer::setUseCriteriaFilter方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: retrieveObject
/**
*
* @param int $objectType
* @param string $objectId
* @return ISyncableFile
*/
public static function retrieveObject($objectType, $objectId)
{
$object = null;
switch ($objectType) {
case FileSyncObjectType::ENTRY:
entryPeer::setUseCriteriaFilter(false);
$object = entryPeer::retrieveByPK($objectId);
entryPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::UICONF:
uiConfPeer::setUseCriteriaFilter(false);
$object = uiConfPeer::retrieveByPK($objectId);
uiConfPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::BATCHJOB:
BatchJobPeer::setUseCriteriaFilter(false);
$object = BatchJobPeer::retrieveByPK($objectId);
BatchJobPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::FLAVOR_ASSET:
assetPeer::setUseCriteriaFilter(false);
$object = assetPeer::retrieveById($objectId);
assetPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::SYNDICATION_FEED:
syndicationFeedPeer::setUseCriteriaFilter(false);
$object = syndicationFeedPeer::retrieveByPK($objectId);
syndicationFeedPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::CONVERSION_PROFILE:
conversionProfile2Peer::setUseCriteriaFilter(false);
$object = conversionProfile2Peer::retrieveByPK($objectId);
conversionProfile2Peer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::FILE_ASSET:
conversionProfile2Peer::setUseCriteriaFilter(false);
$object = FileAssetPeer::retrieveByPK($objectId);
conversionProfile2Peer::setUseCriteriaFilter(true);
break;
}
if ($object == null) {
$object = KalturaPluginManager::loadObject('ISyncableFile', $objectType, array('objectId' => $objectId));
}
if ($object == null) {
$error = __METHOD__ . " Cannot find object type [" . $objectType . "] with object_id [" . $objectId . "]";
KalturaLog::err($error);
throw new kFileSyncException($error);
}
return $object;
}
示例2: getChildJobs
public function getChildJobs(Criteria $c = null)
{
if ($c) {
$c = clone $c;
} else {
$c = new Criteria();
}
BatchJobPeer::setUseCriteriaFilter(false);
// Get by root
$c1 = clone $c;
$c1->addAnd($c1->getNewCriterion(BatchJobPeer::ROOT_JOB_ID, $this->id));
$c1->addAnd($c1->getNewCriterion(BatchJobPeer::PARENT_JOB_ID, $this->id, Criteria::NOT_EQUAL));
$result1 = BatchJobPeer::doSelect($c1, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
// Get by parent
$c->addAnd($c->getNewCriterion(BatchJobPeer::PARENT_JOB_ID, $this->id));
$result2 = BatchJobPeer::doSelect($c, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
// Unite
BatchJobPeer::setUseCriteriaFilter(true);
return array_merge($result1, $result2);
}
示例3: postInsert
/**
* Code to be run after inserting to database
* @param PropelPDO $con
*/
public function postInsert(PropelPDO $con = null)
{
BatchJobPeer::setUseCriteriaFilter(false);
$this->reload();
BatchJobPeer::setUseCriteriaFilter(true);
kEventsManager::raiseEvent(new kObjectCreatedEvent($this));
if ($this->copiedFrom) {
kEventsManager::raiseEvent(new kObjectCopiedEvent($this->copiedFrom, $this));
}
}
示例4: reload
/**
* Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
*
* This will only work if the object has been saved and has a valid primary key set.
*
* @param boolean $deep (optional) Whether to also de-associated any related objects.
* @param PropelPDO $con (optional) The PropelPDO connection to use.
* @return void
* @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
*/
public function reload($deep = false, PropelPDO $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
if ($con === null) {
$con = Propel::getConnection(BatchJobPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
// We don't need to alter the object instance pool; we're just modifying this instance
// already in the pool.
BatchJobPeer::setUseCriteriaFilter(false);
$stmt = BatchJobPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
BatchJobPeer::setUseCriteriaFilter(true);
$row = $stmt->fetch(PDO::FETCH_NUM);
$stmt->closeCursor();
if (!$row) {
throw new PropelException('Cannot find matching row in the database to reload object values.');
}
$this->hydrate($row, 0, true);
// rehydrate
if ($deep) {
// also de-associate any related objects?
$this->aBatchJobLock = null;
$this->collBatchJobLocks = null;
$this->lastBatchJobLockCriteria = null;
$this->collBatchJobLockSuspends = null;
$this->lastBatchJobLockSuspendCriteria = null;
}
// if (deep)
}
示例5: getChildJobs
public function getChildJobs(Criteria $c = null)
{
if (!$c) {
$c = new Criteria();
}
$crit = $c->getNewCriterion(BatchJobPeer::ROOT_JOB_ID, $this->id);
$crit->addOr($c->getNewCriterion(BatchJobPeer::PARENT_JOB_ID, $this->id));
$c->addAnd($crit);
// remove partner id filter in order to force an optimized query. Otherwise mysql may use the partner id key which is
// far from optimal for this direct query using ROOT_JOB_ID and PARENT_JOB_ID keys.
BatchJobPeer::setUseCriteriaFilter(false);
$result = BatchJobPeer::doSelect($c, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
BatchJobPeer::setUseCriteriaFilter(true);
return $result;
}
示例6: objectDeleted
public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
{
/* @var $object FileSync */
$syncKey = kFileSyncUtils::getKeyForFileSync($object);
$entryId = null;
switch ($object->getObjectType()) {
case FileSyncObjectType::ENTRY:
$entryId = $object->getObjectId();
break;
case FileSyncObjectType::BATCHJOB:
BatchJobPeer::setUseCriteriaFilter(false);
$batchJob = BatchJobPeer::retrieveByPK($object->getObjectId());
if ($batchJob) {
$entryId = $batchJob->getEntryId();
}
BatchJobPeer::setUseCriteriaFilter(true);
break;
case FileSyncObjectType::ASSET:
assetPeer::setUseCriteriaFilter(false);
$asset = assetPeer::retrieveById($object->getId());
if ($asset) {
$entryId = $asset->getEntryId();
//the next piece of code checks whether the entry to which
//the deleted asset belongs to is a "replacement" entry
$entry = entryPeer::retrieveByPKNoFilter($entryId);
if (!$entry) {
KalturaLog::alert("No entry found by the ID of [{$entryId}]");
} else {
if ($entry->getReplacedEntryId()) {
KalturaLog::info("Will not handle event - deleted asset belongs to replacement entry");
return;
}
}
}
assetPeer::setUseCriteriaFilter(true);
break;
}
$storage = StorageProfilePeer::retrieveByPK($object->getDc());
kJobsManager::addStorageDeleteJob($raisedJob, $entryId, $storage, $object);
}