本文整理汇总了PHP中entryPeer::getEntryClassByType方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::getEntryClassByType方法的具体用法?PHP entryPeer::getEntryClassByType怎么用?PHP entryPeer::getEntryClassByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryPeer
的用法示例。
在下文中一共展示了entryPeer::getEntryClassByType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareEntryForInsert
/**
* @param KalturaBaseEntry $entry
* @param entry $dbEntry
* @return entry
*/
protected function prepareEntryForInsert(KalturaBaseEntry $entry, entry $dbEntry = null)
{
// create a default name if none was given
if (!$entry->name) {
$entry->name = $this->getPartnerId() . '_' . time();
}
if ($entry->licenseType === null) {
$entry->licenseType = KalturaLicenseType::UNKNOWN;
}
// first copy all the properties to the db entry, then we'll check for security stuff
if (!$dbEntry) {
$entryType = kPluginableEnumsManager::apiToCore('entryType', $entry->type);
$class = entryPeer::getEntryClassByType($entryType);
KalturaLog::debug("Creating new entry of API type [{$entry->type}] core type [{$entryType}] class [{$class}]");
$dbEntry = new $class();
}
$dbEntry = $entry->toInsertableObject($dbEntry);
$this->checkAndSetValidUserInsert($entry, $dbEntry);
$this->checkAdminOnlyInsertProperties($entry);
$this->validateAccessControlId($entry);
$this->validateEntryScheduleDates($entry, $dbEntry);
$dbEntry->setPartnerId($this->getPartnerId());
$dbEntry->setSubpId($this->getPartnerId() * 100);
$dbEntry->setDefaultModerationStatus();
return $dbEntry;
}