protected function get_firstpage() {
        $pages = $this->load_all_pages();
        if (count($pages) > 0) {
            foreach ($pages as $page) {
                if ((int)$page->prevpageid === 0) {
                    return $page;
                }
            }
        }
        return false;
    }
protected function get_firstpage() {
        $pages = $this->load_all_pages();
        if (count($pages) > 0) {
            foreach ($pages as $page) {
                if ((int)$page->prevpageid === 0) {
                    return $page;
                }
            }
        }
        return false;
    }
protected function get_firstpage ( ) { $ pages = $ this -> load_all_pages ( ) ; if ( count ( $ pages ) > 0 ) { foreach ( $ pages as $ page ) { if ( ( int ) $ page -> prevpageid === 0 ) { return $ page ; } } } return false ; }
Returns the first page for the lesson or false if there isn't one.

This method should be called via the magic method __get();
<code>
$firstpage = $lesson->firstpage;
</code>

@return lesson_page|bool Returns the lesson_page specialised object or false
Returns the first page for the lesson or false if there isn t one .