コード例 #1
0
function retrieveSubject($type, $id)
{
    switch ($type) {
        case flag::SUBJECT_TYPE_ENTRY:
            $entry = entryPeer::retrieveByPK($id);
            return 'entry id:' . $id . '<br/>kshow:' . returnKshowLink($entry->getKshowId()) . '<br/>Name:' . $entry->getName();
        case flag::SUBJECT_TYPE_USER:
            $user = kuserPeer::retrieveByPK($id);
            return returnUserLink($user->getScreenName());
        case flag::SUBJECT_TYPE_COMMENT:
            $comment = commentPeer::retrieveByPK($id);
            return 'comment id:' . $id . '<br/>Commnet:' . $comment->getComment();
        default:
            return 'Unknown';
    }
}