/** * generate unique string id for CuePoint */ private function calculateId() { $currentDcId = kDataCenterMgr::getCurrentDcId(); for ($i = 0; $i < 10; $i++) { $id = $currentDcId . '_' . kString::generateStringId(); $existingObject = CuePointPeer::retrieveByPKNoFilter($id); if ($existingObject) { KalturaLog::log(__METHOD__ . ": id [{$id}] already exists"); } else { return $id; } } throw new Exception("Could not find unique id for CuePoint"); }