当前位置: 首页>>代码示例>>PHP>>正文


PHP entryPeer::translateFieldName方法代码示例

本文整理汇总了PHP中entryPeer::translateFieldName方法的典型用法代码示例。如果您正苦于以下问题:PHP entryPeer::translateFieldName方法的具体用法?PHP entryPeer::translateFieldName怎么用?PHP entryPeer::translateFieldName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在entryPeer的用法示例。


在下文中一共展示了entryPeer::translateFieldName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFieldNameFromPeer

 public function getFieldNameFromPeer($field_name)
 {
     try {
         return entryPeer::translateFieldName($field_name, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME);
     } catch (PropelException $e) {
         return 'entry.' . strtoupper($field_name);
     }
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:8,代码来源:entryFilter.class.php

示例2: postUpdate

 public function postUpdate(PropelPDO $con = null)
 {
     if (!$this->wasObjectSaved()) {
         return;
     }
     if ($this->alreadyInSave) {
         return parent::postUpdate($con);
     }
     $objectUpdated = $this->isModified();
     $objectDeleted = false;
     if ($this->isColumnModified(entryPeer::STATUS) && $this->getStatus() == entryStatus::DELETED) {
         $objectDeleted = true;
     }
     if ($this->isColumnModified(entryPeer::DATA) && $this->getMediaType() == entry::ENTRY_MEDIA_TYPE_IMAGE) {
         $partner = $this->getPartner();
         if ($partner) {
             $dataArr = explode('.', $this->getData());
             $id = $this->getId();
             if ($id == $partner->getAudioThumbEntryId()) {
                 $partner->setAudioThumbEntryVersion($dataArr[0]);
                 $partner->save();
             }
             if ($id == $partner->getLiveThumbEntryId()) {
                 $partner->setLiveThumbEntryVersion($dataArr[0]);
                 $partner->save();
             }
         }
     }
     $trackColumns = $this->getTrackColumns();
     $changedProperties = array();
     foreach ($trackColumns as $namespace => $trackColumn) {
         if (is_array($trackColumn)) {
             if (isset($this->oldCustomDataValues[$namespace])) {
                 foreach ($trackColumn as $trackCustomData) {
                     if (isset($this->oldCustomDataValues[$namespace][$trackCustomData])) {
                         $column = $trackCustomData;
                         if ($namespace) {
                             $column = "{$namespace}.{$trackCustomData}";
                         }
                         $previousValue = $this->oldCustomDataValues[$namespace][$trackCustomData];
                         $previousValue = is_scalar($previousValue) ? $previousValue : $this->getTrackEntryString($namespace, $trackCustomData, $previousValue);
                         $newValue = $this->getFromCustomData($trackCustomData, $namespace);
                         $newValue = is_scalar($newValue) ? $newValue : $this->getTrackEntryString($namespace, $trackCustomData, $newValue);
                         $changedProperties[] = "{$column} [{$previousValue}]->[{$newValue}]";
                     }
                 }
             }
         } elseif ($this->isColumnModified($trackColumn)) {
             $column = entryPeer::translateFieldName($trackColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_STUDLYPHPNAME);
             $previousValue = $this->getColumnsOldValue($trackColumn);
             $newValue = $this->getByName($trackColumn, BasePeer::TYPE_COLNAME);
             $changedProperties[] = "{$column} [{$previousValue}]->[{$newValue}]";
         }
     }
     if ($this->getRedirectEntryId() && array_key_exists('', $this->oldCustomDataValues) && array_key_exists('redirectEntryId', $this->oldCustomDataValues[''])) {
         $redirectEntry = entryPeer::retrieveByPK($this->getRedirectEntryId());
         if ($redirectEntry) {
             $redirectEntry->setModerationStatus($this->getModerationStatus());
             $redirectEntry->save();
         }
     }
     $ret = parent::postUpdate($con);
     if ($objectDeleted) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
         myStatisticsMgr::deleteEntry($this);
         $trackEntry = new TrackEntry();
         $trackEntry->setEntryId($this->getId());
         $trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_DELETED_ENTRY);
         $trackEntry->setChangedProperties(implode("\n", $changedProperties));
         $trackEntry->setDescription(__METHOD__ . "[" . __LINE__ . "]");
         TrackEntry::addTrackEntry($trackEntry);
         //In case this entry has sub streams assigned to it we should delete them as well
         $subStreamEntries = entryPeer::retrieveChildEntriesByEntryIdAndPartnerId($this->id, $this->partner_id);
         foreach ($subStreamEntries as $subStreamEntry) {
             myEntryUtils::deleteEntry($subStreamEntry);
         }
     }
     if ($objectUpdated) {
         kEventsManager::raiseEvent(new kObjectUpdatedEvent($this));
         if (!$objectDeleted && count($changedProperties)) {
             $trackEntry = new TrackEntry();
             $trackEntry->setEntryId($this->getId());
             $trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_UPDATE_ENTRY);
             $trackEntry->setChangedProperties(implode("\n", $changedProperties));
             $trackEntry->setDescription(__METHOD__ . "[" . __LINE__ . "]");
             TrackEntry::addTrackEntry($trackEntry);
         }
     }
     return $ret;
 }
开发者ID:AdiTal,项目名称:server,代码行数:90,代码来源:entry.php

示例3: getFieldNameFromPeer

 public function getFieldNameFromPeer($field_name)
 {
     return entryPeer::translateFieldName($field_name, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:4,代码来源:entryFilter.class.php

示例4: setByName

 /**
  * Sets a field from the object by name passed in as a string.
  *
  * @param      string $name peer name
  * @param      mixed $value field value
  * @param      string $type The type of fieldname the $name is of:
  *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  * @return     void
  */
 public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
 {
     $pos = entryPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
     return $this->setByPosition($pos, $value);
 }
开发者ID:richhl,项目名称:kalturaCE,代码行数:15,代码来源:Baseentry.php

示例5: postUpdate

 public function postUpdate(PropelPDO $con = null)
 {
     if (!$this->wasObjectSaved()) {
         return;
     }
     if ($this->alreadyInSave) {
         return parent::postUpdate($con);
     }
     $objectUpdated = $this->isModified();
     $objectDeleted = false;
     if ($this->isColumnModified(entryPeer::STATUS) && $this->getStatus() == entryStatus::DELETED) {
         $objectDeleted = true;
     }
     $trackColumns = array(entryPeer::STATUS, entryPeer::MODERATION_STATUS, entryPeer::KUSER_ID, entryPeer::CREATOR_KUSER_ID, entryPeer::ACCESS_CONTROL_ID);
     $changedProperties = array();
     foreach ($trackColumns as $trackColumn) {
         if ($this->isColumnModified($trackColumn)) {
             $column = entryPeer::translateFieldName($trackColumn, BasePeer::TYPE_COLNAME, BasePeer::TYPE_STUDLYPHPNAME);
             $previousValue = $this->getColumnsOldValue($trackColumn);
             $newValue = $this->getByName($trackColumn, BasePeer::TYPE_COLNAME);
             $changedProperties[] = "{$column} [{$previousValue}]->[{$newValue}]";
         }
     }
     $ret = parent::postUpdate($con);
     if ($objectDeleted) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
         myStatisticsMgr::deleteEntry($this);
         $trackEntry = new TrackEntry();
         $trackEntry->setEntryId($this->getId());
         $trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_DELETED_ENTRY);
         $trackEntry->setChangedProperties(implode("\n", $changedProperties));
         $trackEntry->setDescription(__METHOD__ . "[" . __LINE__ . "]");
         TrackEntry::addTrackEntry($trackEntry);
     }
     if ($objectUpdated) {
         kEventsManager::raiseEvent(new kObjectUpdatedEvent($this));
         if (!$objectDeleted && count($changedProperties)) {
             $trackEntry = new TrackEntry();
             $trackEntry->setEntryId($this->getId());
             $trackEntry->setTrackEventTypeId(TrackEntry::TRACK_ENTRY_EVENT_TYPE_UPDATE_ENTRY);
             $trackEntry->setChangedProperties(implode("\n", $changedProperties));
             $trackEntry->setDescription(__METHOD__ . "[" . __LINE__ . "]");
             TrackEntry::addTrackEntry($trackEntry);
         }
     }
     return $ret;
 }
开发者ID:EfncoPlugins,项目名称:Media-Management-based-on-Kaltura,代码行数:47,代码来源:entry.php


注:本文中的entryPeer::translateFieldName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。