mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT #5072 RSSFeed_Entry::rssField() now respects custom getters on the data class (from r100400)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105559 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8f8a3b2f6e
commit
252be427f7
@ -276,8 +276,7 @@ class RSSFeed_Entry extends ViewableData {
|
|||||||
* @return string Returns the author of the entry.
|
* @return string Returns the author of the entry.
|
||||||
*/
|
*/
|
||||||
function Author() {
|
function Author() {
|
||||||
if($this->authorField)
|
if($this->authorField) return $this->failover->obj($this->authorField);
|
||||||
return $this->failover->obj($this->authorField);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -287,7 +286,10 @@ class RSSFeed_Entry extends ViewableData {
|
|||||||
function rssField($fieldName, $defaultClass = 'Varchar') {
|
function rssField($fieldName, $defaultClass = 'Varchar') {
|
||||||
if($fieldName) {
|
if($fieldName) {
|
||||||
if($this->failover->castingHelperPair($fieldName)) {
|
if($this->failover->castingHelperPair($fieldName)) {
|
||||||
return $this->failover->obj($fieldName);
|
$value = $this->failover->$fieldName;
|
||||||
|
$obj = $this->failover->obj($fieldName);
|
||||||
|
$obj->setValue($value);
|
||||||
|
return $obj;
|
||||||
} else {
|
} else {
|
||||||
$obj = new $defaultClass($fieldName);
|
$obj = new $defaultClass($fieldName);
|
||||||
$obj->setValue($this->failover->XML_val($fieldName));
|
$obj->setValue($this->failover->XML_val($fieldName));
|
||||||
|
@ -59,13 +59,13 @@ class RSSFeedTest_ItemA extends ViewableData {
|
|||||||
'AltContent' => 'Text',
|
'AltContent' => 'Text',
|
||||||
);
|
);
|
||||||
|
|
||||||
function Title() {
|
function getTitle() {
|
||||||
return "ItemA";
|
return "ItemA";
|
||||||
}
|
}
|
||||||
function Content() {
|
function getContent() {
|
||||||
return "ItemA Content";
|
return "ItemA Content";
|
||||||
}
|
}
|
||||||
function AltContent() {
|
function getAltContent() {
|
||||||
return "ItemA AltContent";
|
return "ItemA AltContent";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user