本文整理汇总了PHP中entryPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::retrieveByPk方法的具体用法?PHP entryPeer::retrieveByPk怎么用?PHP entryPeer::retrieveByPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entryPeer
的用法示例。
在下文中一共展示了entryPeer::retrieveByPk方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateId
private static function calculateId()
{
$dc = kDataCenterMgr::getCurrentDc();
for ($i = 0; $i < 10; ++$i) {
$id = $dc["id"] . '_' . kString::generateStringId();
$existing_object = entryPeer::retrieveByPk($id);
if (!$existing_object) {
return $id;
}
}
die;
}
示例2: save
public function save(PropelPDO $con = null)
{
$is_new = false;
if ($this->isNew()) {
$this->setId(self::calculateId());
// start by setting the modified_at to the current time
$this->setModifiedAt(time());
$this->setModerationCount(0);
if (is_null($this->getAccessControlId())) {
$partner = $this->getPartner();
if ($partner) {
$this->setAccessControlId($partner->getDefaultAccessControlId());
}
}
// only media clips should increments - not roughcuts or backgrounds
if ($this->type == entryType::MEDIA_CLIP) {
myStatisticsMgr::addEntry($this);
}
$is_new = true;
}
if ($this->type == entryType::MIX) {
// some of the properties should be copied to the kshow
$kshow = $this->getkshow();
if ($kshow) {
$modified = false;
if ($kshow->getRank() != $this->getRank()) {
$kshow->setRank($this->getRank());
$modified = true;
}
if ($kshow->getLengthInMsecs() != $this->getLengthInMsecs()) {
$kshow->setLengthInMsecs($this->getLengthInMsecs());
$modified = true;
}
if ($modified) {
$kshow->save();
}
} else {
$this->log("entry [" . $this->getId() . "] does not have a real kshow with id [" . $this->getKshowId() . "]", Propel::LOG_WARNING);
}
}
myPartnerUtils::setPartnerIdForObj($this);
if ($this->getDisplayInSearch() != mySearchUtils::DISPLAY_IN_SEARCH_SYSTEM) {
mySearchUtils::setDisplayInSearch($this);
}
ktagword::updateAdminTags($this);
// same for puserId ...
$this->getPuserId();
// make sure this entry is saved before calling updateAllMetadataVersionsRelevantForEntry, since fixMetadata retrieves the entry from the DB
// and checks its data path which was modified above.
$res = parent::save($con);
if ($is_new) {
// when retrieving the entry - ignore thr filter - when in partner has moderate_content =1 - the entry will have status=3 and will fail the retrieveByPk
entryPeer::setUseCriteriaFilter(false);
$obj = entryPeer::retrieveByPk($this->getId());
$this->setIntId($obj->getIntId());
entryPeer::setUseCriteriaFilter(true);
}
if ($this->should_call_set_data_content) {
// calling the funciton with null will cause it to use the $this->data_content
$this->setDataContent(null);
$res = parent::save($con);
}
// the fix should be done whether the status is READY or ERROR_CONVERTING
if ($this->getStatus() == entryStatus::READY || $this->getStatus() == entryStatus::ERROR_CONVERTING) {
// fire some stuff due to the new status
$version_to_update = $this->getUpdateWhenReady();
if ($version_to_update) {
try {
myMetadataUtils::updateAllMetadataVersionsRelevantForEntry($this);
$this->resetUpdateWhenReady();
$res = parent::save($con);
} catch (Exception $e) {
KalturaLog::err($e->getMessage());
}
}
}
$this->syncCategories();
return $res;
}
示例3: getentry
/**
* Get the associated entry object
*
* @param PropelPDO Optional Connection object.
* @return entry The associated entry object.
* @throws PropelException
*/
public function getentry(PropelPDO $con = null)
{
if ($this->aentry === null && ($this->entry_id !== "" && $this->entry_id !== null)) {
$this->aentry = entryPeer::retrieveByPk($this->entry_id);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aentry->addassets($this);
*/
}
return $this->aentry;
}
示例4: getentry
public function getentry(PropelPDO $con = null)
{
return entryPeer::retrieveByPk($this->entry_id);
}