本文整理汇总了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();
}
示例2: setValue
function setValue($data)
{
if ($this->buyable) {
$value = $this->buyable->FullName ? $this->buyable->FullName : $this->buyable->getTitle();
//to TEST!!!
$this->fieldSelectedBuyable->setValue($value);
}
}
示例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...");
}
}
示例4: getTitle
public function getTitle()
{
if ($this->EmailAddress) {
return $this->EmailAddress;
}
if ($this->EmailSubject) {
return $this->EmailSubject;
}
return parent::getTitle();
}
示例5: getTitle
public function getTitle()
{
if ($this->Caption) {
return $this->dbObject('Caption')->FirstSentence();
}
if ($image = $this->Image()) {
return $image->Title;
}
return parent::getTitle();
}
示例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);
}