當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BaseObject::getId方法代碼示例

本文整理匯總了PHP中BaseObject::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseObject::getId方法的具體用法?PHP BaseObject::getId怎麽用?PHP BaseObject::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BaseObject的用法示例。


在下文中一共展示了BaseObject::getId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: copyMetadata

 /**
  * @param KalturaMetadataObjectType $objectType
  * @param BaseObject $fromObject
  * @param BaseObject $toObject
  */
 protected function copyMetadata($objectType, BaseObject $fromObject, BaseObject $toObject)
 {
     KalturaLog::debug("Copy metadata type [{$objectType}] from " . get_class($fromObject) . '[' . $fromObject->getId() . "] to[" . $toObject->getId() . "]");
     $c = new Criteria();
     $c->add(MetadataPeer::OBJECT_TYPE, $objectType);
     $c->add(MetadataPeer::OBJECT_ID, $fromObject->getId());
     $metadatas = MetadataPeer::doSelect($c);
     foreach ($metadatas as $metadata) {
         $newMetadata = $metadata->copy();
         $newMetadata->setObjectId($toObject->getId());
         if ($toObject instanceof Partner) {
             $newMetadata->setPartnerId($toObject->getId());
         } else {
             $newMetadata->setPartnerId($toObject->getPartnerId());
         }
         $metadataProfileId = kObjectCopyHandler::getMappedId('MetadataProfile', $metadata->getMetadataProfileId());
         if ($metadataProfileId) {
             $metadataProfile = MetadataProfilePeer::retrieveByPK($metadataProfileId);
             if ($metadataProfile) {
                 $newMetadata->setMetadataProfileId($metadataProfileId);
                 $newMetadata->setMetadataProfileVersion($metadataProfile->getVersion());
             }
         }
         $newMetadata->save();
         kFileSyncUtils::createSyncFileLinkForKey($newMetadata->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA), $metadata->getSyncKey(Metadata::FILE_SYNC_METADATA_DATA));
     }
 }
開發者ID:kubrickfr,項目名稱:server,代碼行數:32,代碼來源:kMetadataObjectCopiedHandler.php

示例2: getKey

 public function getKey()
 {
     if (method_exists($this->toObject, 'getId')) {
         return get_class($this->object) . $this->toObject->getId();
     }
     return null;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:7,代碼來源:kObjectCopiedEvent.php

示例3: calculateCrumb

 protected function calculateCrumb(BaseObject $object)
 {
     $parentId = $object->getParentId();
     if (!$parentId) {
         $this->crumbsByObjectId[$object->getId()] = array($object->getName());
         return $this->crumbsByObjectId[$object->getId()];
     }
     if (isset($this->crumbsByObjectId[$parentId])) {
         $this->crumbsByObjectId[$object->getId()] = $this->crumbsByObjectId[$parentId];
         $this->crumbsByObjectId[$object->getId()][] = $object->getName();
         return $this->crumbsByObjectId[$object->getId()];
     }
     $storage = $object->getStorage();
     $fake = Driver::getInstance()->getFakeSecurityContext();
     $this->crumbsByObjectId[$object->getId()] = array();
     foreach ($object->getParents($fake, array('select' => array('ID', 'NAME', 'TYPE')), SORT_DESC) as $parent) {
         if ($parent->getId() == $storage->getRootObjectId()) {
             continue;
         }
         $this->crumbsByObjectId[$object->getId()][] = $parent->getName();
     }
     unset($parent);
     $this->crumbsByObjectId[$parentId] = $this->crumbsByObjectId[$object->getId()];
     $this->crumbsByObjectId[$object->getId()][] = $object->getName();
     return $this->crumbsByObjectId[$object->getId()];
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:26,代碼來源:crumbstorage.php

示例4: doConsume

 /**
  * @param kObjectSavedEventConsumer $consumer
  * @return bool true if should continue to the next consumer
  */
 protected function doConsume(KalturaEventConsumer $consumer)
 {
     if (!$consumer->shouldConsumeSavedEvent($this->object)) {
         return true;
     }
     $additionalLog = '';
     if (method_exists($this->object, 'getId')) {
         $additionalLog .= 'id [' . $this->object->getId() . ']';
     }
     KalturaLog::debug(get_class($this) . ' event consumed by ' . get_class($consumer) . ' object type [' . get_class($this->object) . '] ' . $additionalLog);
     return $consumer->objectSaved($this->object);
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:16,代碼來源:kObjectSavedEvent.php

示例5: doConsume

 /**
  * @param kObjectSavedEventConsumer $consumer
  * @return bool true if should continue to the next consumer
  */
 protected function doConsume(KalturaEventConsumer $consumer)
 {
     if (!$consumer->shouldConsumeSavedEvent($this->object)) {
         return true;
     }
     $additionalLog = '';
     if (method_exists($this->object, 'getId')) {
         $additionalLog .= 'id [' . $this->object->getId() . ']';
     }
     KalturaLog::debug('consumer [' . get_class($consumer) . '] started handling [' . get_class($this) . '] object type [' . get_class($this->object) . '] ' . $additionalLog);
     $result = $consumer->objectSaved($this->object);
     KalturaLog::debug('consumer [' . get_class($consumer) . '] finished handling [' . get_class($this) . '] object type [' . get_class($this->object) . '] ' . $additionalLog);
     return $result;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:18,代碼來源:kObjectSavedEvent.php

示例6: getRecommendations

    /**
     * Returns recommended objects which the user has not rated based on his/her 
     * rating of other objects.
     * 
     * This implementation is based on the 
     * OpenSlopeOne project by Chaoqun Fu, http://code.google.com/p/openslopeone/.
     * 
     * @param BaseObject $object The user for which to return the recommendations
     * @param string $model The name of the class for which to return recommendations
     * @param int $limit The number of recommendation objects which should be returned. 
     * Use NULL for returning all recommended objects
     * @return array of sfRecommendationObject objects which wrap the recommended objects
     */
    public function getRecommendations(BaseObject $object, $model, $limit = NULL)
    {
        $parser = new sfPropelSlopeOneSqlParser();
        $slopeQuery = 'SELECT 	sf_slope_one.item2_id AS id, 
    												SUM((%ratings%.%rating% * sf_slope_one.times) - sf_slope_one.rating)/
                            SUM(sf_slope_one.times) AS rating
                    FROM sf_slope_one, %ratings% 
                    WHERE %ratings%.%rater_id% = :rater_id AND
                          %ratings%.%rateable_model% = :item_model AND
                          %ratings%.%rateable_id% = sf_slope_one.item1_id AND
                          %ratings%.%rateable_model% = sf_slope_one.item1_model AND
                          sf_slope_one.item2_id NOT IN (SELECT %ratings%.%rateable_id% 
														                          	FROM %ratings% 
														                          	WHERE %ratings%.%rater_id% = :rater_id)
                    GROUP BY item2_id
                    ORDER BY rating DESC';
        $slopeQuery .= isset($limit) ? ' LIMIT ' . $limit : '';
        $connection = Propel::getConnection();
        $statement = $connection->prepare($parser->parse($slopeQuery));
        $statement->execute(array('rater_id' => $object->getId(), 'item_model' => $model));
        $ratings = array();
        while ($result = $statement->fetch()) {
            $ratings[$result['id']] = $result['rating'];
        }
        $modelObject = new $model();
        $objects = call_user_func(array(get_class($modelObject->getPeer()), 'retrieveByPKs'), array_keys($ratings));
        foreach ($objects as &$object) {
            $object = new sfSlopeOneRecommendation($object, $ratings[$object->getId()]);
        }
        return $objects;
    }
開發者ID:kasperg,項目名稱:symfony-propel-slope-one-recommendations-plugin,代碼行數:44,代碼來源:sfPropelActAsSlopeOneRaterBehavior.php

示例7: attachCreatedObject

 /**
  * @param BaseObject $object
  */
 public function attachCreatedObject(BaseObject $object)
 {
     $dropFolderFile = DropFolderFilePeer::retrieveByPK($this->getDropFolderFileId());
     $dropFolder = DropFolderPeer::retrieveByPK($dropFolderFile->getDropFolderId());
     $entryId = $asset = null;
     // create import job for remote drop folder files
     if ($dropFolder instanceof RemoteDropFolder) {
         // get params
         if ($object instanceof asset) {
             $entryId = $object->getEntryId();
             $asset = $object;
         } else {
             if ($object instanceof entry) {
                 $entryId = $object->getId();
                 $asset = null;
             } else {
                 return;
             }
         }
         $importUrl = $dropFolder->getFolderUrl();
         $importUrl .= '/' . $dropFolderFile->getFileName();
         $jobData = $dropFolder->getImportJobData();
         $jobData->setDropFolderFileId($this->getDropFolderFileId());
         // add job
         kJobsManager::addImportJob(null, $entryId, $dropFolderFile->getPartnerId(), $importUrl, $asset, $dropFolder->getFileTransferMgrType(), $jobData);
         // set file status to DOWNLOADING
         $dropFolderFile->setStatus(DropFolderFileStatus::DOWNLOADING);
         $dropFolderFile->save();
     }
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:33,代碼來源:kDropFolderFileResource.php

示例8: getRecommendations

    /**
     * Returns objects of the same class and with similar ratings as the current rateable object.
     * 
     * This implementation is based on the 
     * OpenSlopeOne project by Chaoqun Fu, http://code.google.com/p/openslopeone/.
     *
     * @param BaseObject $object The rateable object for which to return other recommended object
     * @param int $limit The number of recommendation objects which should be returned. Use NULL for returning all recommended objects
     * @return array of sfRecommendationObject objects which wrap the recommended objects
     */
    public function getRecommendations(BaseObject $object, $limit = NULL)
    {
        $parser = new sfPropelSlopeOneSqlParser();
        $slopeQuery = 'SELECT 	item2_id AS id,
    												SUM(rating/times) AS rating
                    FROM sf_slope_one 
                    WHERE item1_id = :item_id AND 
													item1_model = :item_model AND
                          item1_model = item2_model
                    GROUP BY item2_id
                    ORDER BY rating DESC';
        $slopeQuery .= isset($limit) ? ' LIMIT ' . $limit : '';
        $connection = Propel::getConnection();
        $statement = $connection->prepare($parser->parse($slopeQuery));
        $statement->execute(array('item_id' => $object->getId(), 'item_model' => get_class($object)));
        $ratings = array();
        while ($result = $statement->fetch()) {
            $ratings[$result['id']] = $result['rating'];
        }
        $objects = call_user_func(array(get_class($object->getPeer()), 'retrieveByPKs'), array_keys($ratings));
        foreach ($objects as &$object) {
            $object = new sfSlopeOneRecommendation($object, $ratings[$object->getId()]);
        }
        return $objects;
    }
開發者ID:kasperg,項目名稱:symfony-propel-slope-one-recommendations-plugin,代碼行數:35,代碼來源:sfPropelActAsSlopeOneRateableBehavior.php

示例9: objectAdded

 /**
  * @param BaseObject $object
  * @return bool true if should continue to the next consumer
  */
 public function objectAdded(BaseObject $object)
 {
     if (!$object instanceof FileSync || $object->getStatus() != FileSync::FILE_SYNC_STATUS_PENDING || $object->getFileType() != FileSync::FILE_SYNC_FILE_TYPE_FILE || $object->getDc() == kDataCenterMgr::getCurrentDcId()) {
         return true;
     }
     $c = new Criteria();
     $c->addAnd(FileSyncPeer::OBJECT_ID, $object->getObjectId());
     $c->addAnd(FileSyncPeer::VERSION, $object->getVersion());
     $c->addAnd(FileSyncPeer::OBJECT_TYPE, $object->getObjectType());
     $c->addAnd(FileSyncPeer::OBJECT_SUB_TYPE, $object->getObjectSubType());
     $c->addAnd(FileSyncPeer::ORIGINAL, '1');
     $original_filesync = FileSyncPeer::doSelectOne($c);
     if (!$original_filesync) {
         KalturaLog::err('Original filesync not found for object_id[' . $object->getObjectId() . '] version[' . $object->getVersion() . '] type[' . $object->getObjectType() . '] subtype[' . $object->getObjectSubType() . ']');
         return true;
     }
     $sourceFileUrl = $original_filesync->getExternalUrl();
     if (!$sourceFileUrl) {
         KalturaLog::err('External URL not found for filesync id [' . $object->getId() . ']');
         return true;
     }
     $job = kMultiCentersManager::addFileSyncImportJob($this->getEntryId($object), $object->getPartnerId(), $object->getId(), $sourceFileUrl);
     $job->setDc($object->getDc());
     $job->save();
     return true;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:30,代碼來源:kMultiCentersSynchronizer.php

示例10: objectCopied

 /**
  * @param BaseObject $fromObject
  * @param BaseObject $toObject
  * @return bool true if should continue to the next consumer
  */
 public function objectCopied(BaseObject $fromObject, BaseObject $toObject)
 {
     if ($fromObject instanceof Partner) {
         $this->copyDistributionProfiles($fromObject->getId(), $toObject->getId());
     }
     return true;
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:12,代碼來源:kContentDistributionObjectCopiedHandler.php

示例11: execute

 /**
  * Execute method reload
  *
  * @param string $request 
  * @return array
  * @author Łukasz Wojciechowski
  */
 public function execute($request)
 {
     if ($request->isMethod('post')) {
         if ($this->processPostData()) {
             $result = array('success' => true, 'message' => "Saved with success!", 'redirect' => $this->widgetUri . '?id=' . $this->object->getId());
             return $result;
         }
     }
 }
開發者ID:cbsistem,項目名稱:appflower_engine,代碼行數:16,代碼來源:simpleWidgetEditAction.class.php

示例12: objectDeleted

 public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
 {
     $shortLinks = ShortLinkPeer::retrieveByKuserId($object->getId());
     foreach ($shortLinks as $shortLink) {
         $shortLink->setStatus(ShortLinkStatus::DELETED);
         $shortLink->save();
     }
     return true;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:9,代碼來源:kShortLinkFlowManager.php

示例13: objectCreated

 public function objectCreated(BaseObject $object)
 {
     /* @var $object entry */
     $partner = $object->getPartner();
     $velocixLiveParamsJSON = json_decode($partner->getLiveStreamProvisionParams());
     if (!isset($velocixLiveParamsJSON->velocix) || !isset($velocixLiveParamsJSON->velocix->userName) || !isset($velocixLiveParamsJSON->velocix->password)) {
         $object->setStatus(entryStatus::ERROR_IMPORTING);
         $object->save();
         return true;
     }
     if (isset($velocixLiveParamsJSON->velocix->streamNamePrefix)) {
         $object->setStreamName($velocixLiveParamsJSON->velocix->streamNamePrefix . '_' . $object->getId());
     } else {
         $object->setStreamName($object->getId());
     }
     $object->save();
     return true;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:18,代碼來源:kVelocixLiveFlowManager.php

示例14: objectDeleted

 public function objectDeleted(BaseObject $object, BatchJob $raisedJob = null)
 {
     if ($object instanceof entry) {
         $this->entryDeleted($object->getId());
     }
     if ($object instanceof CuePoint) {
         $this->cuePointDeleted($object);
     }
     return true;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:10,代碼來源:kCuePointManager.php

示例15: contribute

 public function contribute(BaseObject $object, SimpleXMLElement $mrss, kMrssParameters $mrssParams = null)
 {
     if (!$object instanceof entry) {
         return;
     }
     $entryDistributions = EntryDistributionPeer::retrieveByEntryId($object->getId());
     foreach ($entryDistributions as $entryDistribution) {
         $this->contributeDistribution($entryDistribution, $mrss);
     }
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:10,代碼來源:kContentDistributionMrssManager.php


注:本文中的BaseObject::getId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。