PHP code example of evanshunt / lumberjack-sort-and-summary

1. Go to this page and download the library: Download evanshunt/lumberjack-sort-and-summary library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

evanshunt / lumberjack-sort-and-summary example snippets


namespace MyNamespace;

use Page;

class StoryLandingPage extends Page
{
    private static $allowed_children = [
        StoryDetailsPage::class
    ];
}

namespace MyNamespace;

use Page;

class StoryDetailsPage extends Page
{
    private static $table_name = 'StoryDetails';
    private static $singular_name = 'Story';
    private static $plural_name = 'Stories';

    private static $can_be_root = false;
    private static $default_parent = StoryLandingPage::class;

    private static $db = [
        'PublicationDate' => 'Date',
    ];

    private static $summary_fields = [
        'Title',
        'PublicationDate'
    ];

    private static $default_sort = 'PublicationDate DESC';
}