helper static method to get title text based on a notice
This commit is contained in:
parent
e2128b2019
commit
67ff9ea490
@ -115,4 +115,22 @@ class Notice_title extends Memcached_DataObject
|
|||||||
{
|
{
|
||||||
return array(false, false, false);
|
return array(false, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a notice title based on the notice
|
||||||
|
*
|
||||||
|
* @param Notice $notice Notice to fetch a title for
|
||||||
|
*
|
||||||
|
* @return string title of the notice, or null if none
|
||||||
|
*/
|
||||||
|
|
||||||
|
static function fromNotice(Notice $notice)
|
||||||
|
{
|
||||||
|
$nt = Notice_title::staticGet('notice_id', $notice->id);
|
||||||
|
if (empty($nt)) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return $nt->title;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user