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


PHP DataObject::getTitle方法代码示例

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


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

示例1: getTitle

 public function getTitle()
 {
     if ($this->AlbumName) {
         return $this->AlbumName;
     }
     return parent::getTitle();
 }
开发者ID:helpfulrobot,项目名称:tractorcow-silverstripe-imagegallery,代码行数:7,代码来源:ImageGalleryAlbum.php

示例2: setValue

 function setValue($data)
 {
     if ($this->buyable) {
         $value = $this->buyable->FullName ? $this->buyable->FullName : $this->buyable->getTitle();
         //to TEST!!!
         $this->fieldSelectedBuyable->setValue($value);
     }
 }
开发者ID:nieku,项目名称:silverstripe-ecommerce,代码行数:8,代码来源:BuyableSelectField.php

示例3: setValue

 /**
  * Do we do anything with data???
  */
 function setValue($data)
 {
     if ($this->buyable) {
         $value = $this->buyable->FullName ? $this->buyable->FullName : $this->buyable->getTitle();
         //to TEST!!!
         $this->fieldSelectedBuyable->setValue("Once you have selected a new value, it will appear here...");
     }
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:11,代码来源:BuyableSelectField.php

示例4: getTitle

 public function getTitle()
 {
     if ($this->EmailAddress) {
         return $this->EmailAddress;
     }
     if ($this->EmailSubject) {
         return $this->EmailSubject;
     }
     return parent::getTitle();
 }
开发者ID:camfindlay,项目名称:silverstripe-userforms,代码行数:10,代码来源:UserDefinedForm_EmailRecipient.php

示例5: getTitle

 public function getTitle()
 {
     if ($this->Caption) {
         return $this->dbObject('Caption')->FirstSentence();
     }
     if ($image = $this->Image()) {
         return $image->Title;
     }
     return parent::getTitle();
 }
开发者ID:helpfulrobot,项目名称:tractorcow-silverstripe-imagegallery,代码行数:10,代码来源:ImageGalleryItem.php

示例6: newRecordJSTemplateData

 /**
  * Updates the Upload/Attach response from the UploadField
  * with the new DataObject records for the JS template
  * 
  * @param  DataObject $record Newly create DataObject record
  * @param  array $uploadResponse Upload or Attach response from UploadField
  * @return array                 Updated $uploadResponse with $record data
  */
 protected function newRecordJSTemplateData(DataObject &$record, &$uploadResponse)
 {
     // fetch uploadedFile record and sort out previewURL
     // update $uploadResponse datas in case changes happened onAfterWrite()
     $uploadedFile = DataObject::get_by_id($this->component->getFileRelationClassName($this->gridField), $uploadResponse['id']);
     if ($uploadedFile) {
         $uploadResponse['name'] = $uploadedFile->Name;
         $uploadResponse['url'] = $uploadedFile->getURL();
         if ($uploadedFile instanceof Image) {
             $uploadResponse['thumbnail_url'] = $uploadedFile->CroppedImage(30, 30)->getURL();
         } else {
             $uploadResponse['thumbnail_url'] = $uploadedFile->Icon();
         }
         // check if our new record has a Title, if not create one automatically
         $title = $record->getTitle();
         if (!$title || $title === $record->ID) {
             if ($record->hasDatabaseField('Title')) {
                 $record->Title = $uploadedFile->Title;
                 $record->write();
             } else {
                 if ($record->hasDatabaseField('Name')) {
                     $record->Name = $uploadedFile->Title;
                     $record->write();
                 }
             }
         }
     }
     // Collect all data for JS template
     $return = array_merge($uploadResponse, array('record' => array('id' => $record->ID)));
     return $return;
 }
开发者ID:helpfulrobot,项目名称:colymba-gridfield-bulk-editing-tools,代码行数:39,代码来源:GridFieldBulkUpload_Request.php

示例7: sidebarRelatedItems

 /**
  * Model 'related' sidebar
  *
  * @param SidebarController $sidebar
  * @param DataObject $model
  * @param array $whitelist only show actions with these names in the related sidebar
  */
 protected function sidebarRelatedItems(SidebarController $sidebar, DataObject $model, $whitelist = NULL)
 {
     $sidebarlist = array();
     // need to get the module name from the controller name
     $action_name = array('new' => 'new');
     foreach ($model->getLinkRules() as $name => $hasmany) {
         if (method_exists($this, $name)) {
             $controller_name = $this->name;
             $action_name['link'] = $name;
             $field = $hasmany['field'];
         } elseif (method_exists($this, 'view' . $name)) {
             $controller_name = $this->name;
             $action_name['link'] = 'view' . $name;
             $field = $hasmany['field'];
         } elseif (method_exists($this, 'view_' . $name)) {
             $controller_name = $this->name;
             $action_name['link'] = 'view_' . $name;
             $field = $hasmany['field'];
         } else {
             $controller_name = $hasmany['do'] . 's';
             $action_name['link'] = 'view_' . strtolower(str_replace(' ', '_', $model->getTitle()));
             $field = $hasmany['fkfield'];
         }
         $link = array();
         foreach ($hasmany['actions'] as $action) {
             if (!is_null($whitelist) && !in_array($name, $whitelist)) {
                 continue;
             }
             if ($action == 'new') {
                 $controller_name = $hasmany['do'] . 's';
                 $field = $hasmany['fkfield'];
             }
             $modules = isset($hasmany['modules'][$action]) ? $hasmany['modules'][$action] : $this->_modules;
             if (isset($hasmany['newtab'][$action])) {
                 $link[$action] = array('modules' => $modules, 'controller' => $controller_name, 'action' => strtolower($action_name[$action]), $field => $model->{$model->idField}, 'newtab' => TRUE);
             } else {
                 $link[$action] = array('modules' => $modules, 'controller' => $controller_name, 'action' => strtolower($action_name[$action]), $field => $model->{$model->idField});
             }
         }
         if (!empty($link)) {
             $sidebarlist[$name] = array_merge(array('tag' => isset($hasmany['label']) ? $hasmany['label'] : 'Show ' . $name), $link);
         }
     }
     $sidebar->addList('related_items', $sidebarlist);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:52,代码来源:Controller.php


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