View difference between Paste ID: f5106bdce and
SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | <?php |
2 | /** | |
3 | * Defines the SongHolder page type | |
4 | */ | |
5 | class SongHolder extends Page { | |
6 | static $db = array( | |
7 | ); | |
8 | static $has_one = array( | |
9 | ); | |
10 | ||
11 | static $allowed_children = array('SongDetailPage'); | |
12 | } | |
13 | ||
14 | class SongHolder_Controller extends Page_Controller | |
15 | { | |
16 | ||
17 | function song() | |
18 | { | |
19 | static $song = null; | |
20 | ||
21 | if(!$song) | |
22 | { | |
23 | if($id = (int) Director::urlParam('ID')) | |
24 | { | |
25 | $song = DataObject::get_by_id("Song", $id); | |
26 | } | |
27 | } | |
28 | ||
29 | return $song; | |
30 | } | |
31 | } | |
32 | ?> |