本文整理汇总了PHP中kEventsManager::raiseEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP kEventsManager::raiseEvent方法的具体用法?PHP kEventsManager::raiseEvent怎么用?PHP kEventsManager::raiseEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kEventsManager
的用法示例。
在下文中一共展示了kEventsManager::raiseEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postUpdate
public function postUpdate(PropelPDO $con = null)
{
parent::postUpdate($con);
if (!$this->alreadyInSave) {
kEventsManager::raiseEvent(new kObjectUpdatedEvent($this));
}
}
示例2: updateBatchJob
public static function updateBatchJob(BatchJob $batchJob, $status, BatchJob $twinJob = null)
{
$batchJob->setStatus($status);
$batchJob->save();
$event = new kBatchJobStatusEvent($batchJob, $twinJob);
kEventsManager::raiseEvent($event);
$batchJob->reload();
return $batchJob;
}
示例3: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(conversionProfile2Peer::DELETED_AT) && !is_null($this->getDeletedAt())) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例4: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(MetadataProfilePeer::STATUS) && $this->getStatus() == self::STATUS_DEPRECATED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例5: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(BasesyndicationFeedPeer::STATUS) && $this->getStatus() == self::SYNDICATION_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例6: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(UploadTokenPeer::STATUS) && $this->getStatus() == self::UPLOAD_TOKEN_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例7: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(AnnotationPeer::STATUS) && $this->getStatus() == AnnotationStatus::ANNOTATION_STATUS_DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例8: updateBatchJob
/**
* @param BatchJob $batchJob
* @param int $status
* @return BatchJob
*/
public static function updateBatchJob(BatchJob $batchJob, $status)
{
$batchJob->setStatus($status);
$changed = $batchJob->save();
if (!$changed) {
return $batchJob;
}
$event = new kBatchJobStatusEvent($batchJob);
kEventsManager::raiseEvent($event);
$batchJob->reload();
return $batchJob;
}
示例9: postUpdate
public function postUpdate(PropelPDO $con = null)
{
$objectDeleted = false;
if ($this->isColumnModified(flavorAssetPeer::STATUS) && $this->getStatus() == self::FLAVOR_ASSET_STATUS_DELETED || $this->isColumnModified(flavorAssetPeer::DELETED_AT) && !is_null($this->getDeletedAt(null))) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例10: entryDeleted
/**
* @param int $entryId
*/
protected function entryDeleted($entryId)
{
$c = new Criteria();
$c->add(CuePointPeer::ENTRY_ID, $entryId);
CuePointPeer::setUseCriteriaFilter(false);
$cuePoints = CuePointPeer::doSelect($c);
$update = new Criteria();
$update->add(CuePointPeer::STATUS, CuePointStatus::DELETED);
$con = Propel::getConnection(myDbHelper::DB_HELPER_CONN_MASTER);
BasePeer::doUpdate($c, $update, $con);
foreach ($cuePoints as $cuePoint) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($cuePoint));
}
}
示例11: entryDeleted
/**
* @param int $entryId
*/
protected function entryDeleted($entryId)
{
$c = new Criteria();
$c->add(AnnotationPeer::ENTRY_ID, $entryId);
$c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED, Criteria::NOT_EQUAL);
AnnotationPeer::setUseCriteriaFilter(false);
$annotations = AnnotationPeer::doSelect($c);
foreach ($annotations as $annotation) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($annotation));
}
$update = new Criteria();
$update->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED);
$con = Propel::getConnection(AnnotationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
BasePeer::doUpdate($c, $update, $con);
}
示例12: postUpdate
public function postUpdate(PropelPDO $con = null)
{
if ($this->alreadyInSave) {
return parent::postUpdate($con);
}
$objectDeleted = false;
if ($this->isColumnModified(accessControlPeer::DELETED_AT) && !is_null($this->getDeletedAt())) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例13: postUpdate
public function postUpdate(PropelPDO $con = null)
{
if ($this->alreadyInSave) {
return parent::postUpdate($con);
}
$objectDeleted = false;
if ($this->isColumnModified(ShortLinkPeer::STATUS) && $this->getStatus() == ShortLinkStatus::DELETED) {
$objectDeleted = true;
}
$ret = parent::postUpdate($con);
if ($objectDeleted) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
}
return $ret;
}
示例14: addFromUploadedFileAction
/**
* Add new document entry after the specific document file was uploaded and the upload token id exists
*
* @action addFromUploadedFile
* @param KalturaDocumentEntry $documentEntry Document entry metadata
* @param string $uploadTokenId Upload token id
* @return KalturaDocumentEntry The new document entry
*
* @throws KalturaErrors::PROPERTY_VALIDATION_MIN_LENGTH
* @throws KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL
* @throws KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN
*/
function addFromUploadedFileAction(KalturaDocumentEntry $documentEntry, $uploadTokenId)
{
try {
// check that the uploaded file exists
$entryFullPath = kUploadTokenMgr::getFullPathByUploadTokenId($uploadTokenId);
} catch (kCoreException $ex) {
if ($ex->getCode() == kUploadTokenException::UPLOAD_TOKEN_INVALID_STATUS) {
}
throw new KalturaAPIException(KalturaErrors::UPLOAD_TOKEN_INVALID_STATUS_FOR_ADD_ENTRY);
throw $ex;
}
if (!file_exists($entryFullPath)) {
$remoteDCHost = kUploadTokenMgr::getRemoteHostForUploadToken($uploadTokenId, kDataCenterMgr::getCurrentDcId());
if ($remoteDCHost) {
kFile::dumpApiRequest($remoteDCHost);
} else {
throw new KalturaAPIException(KalturaErrors::UPLOADED_FILE_NOT_FOUND_BY_TOKEN);
}
}
$dbEntry = $this->prepareEntryForInsert($documentEntry);
$dbEntry->setSource(KalturaSourceType::FILE);
$dbEntry->setSourceLink("file:{$entryFullPath}");
$dbEntry->save();
$te = new TrackEntry();
$te->setEntryId($dbEntry->getId());
$te->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_ADD_ENTRY);
$te->setDescription(__METHOD__ . ":" . __LINE__ . "::ENTRY_MEDIA_SOURCE_FILE");
TrackEntry::addTrackEntry($te);
$msg = null;
$flavorAsset = kFlowHelper::createOriginalFlavorAsset($this->getPartnerId(), $dbEntry->getId(), $msg);
if (!$flavorAsset) {
KalturaLog::err("Flavor asset not created for entry [" . $dbEntry->getId() . "] reason [{$msg}]");
$dbEntry->setStatus(entryStatus::ERROR_CONVERTING);
$dbEntry->save();
} else {
$ext = pathinfo($entryFullPath, PATHINFO_EXTENSION);
KalturaLog::info("Uploaded file extension: {$ext}");
$flavorAsset->setFileExt($ext);
$flavorAsset->save();
$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_FLAVOR_ASSET_SUB_TYPE_ASSET);
kFileSyncUtils::moveFromFile($entryFullPath, $syncKey);
kEventsManager::raiseEvent(new kObjectAddedEvent($flavorAsset));
}
kUploadTokenMgr::closeUploadTokenById($uploadTokenId);
myNotificationMgr::createNotification(kNotificationJobData::NOTIFICATION_TYPE_ENTRY_ADD, $dbEntry);
$documentEntry->fromObject($dbEntry);
return $documentEntry;
}
示例15: deleteMetadataObjects
/**
* @param int $objectType
* @param string $objectId
*/
protected function deleteMetadataObjects($objectType, $objectId)
{
$c = new Criteria();
$c->add(MetadataPeer::OBJECT_TYPE, $objectType);
$c->add(MetadataPeer::OBJECT_ID, $objectId);
$c->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED, Criteria::NOT_EQUAL);
$peer = null;
MetadataPeer::setUseCriteriaFilter(false);
$metadatas = MetadataPeer::doSelect($c);
foreach ($metadatas as $metadata) {
kEventsManager::raiseEvent(new kObjectDeletedEvent($metadata));
}
$update = new Criteria();
$update->add(MetadataPeer::STATUS, Metadata::STATUS_DELETED);
$con = Propel::getConnection(MetadataPeer::DATABASE_NAME, Propel::CONNECTION_READ);
BasePeer::doUpdate($c, $update, $con);
}