<?php
/**
 * @package     DOCman
 * @copyright   Copyright (C) 2019 Timble CVBA. (http://www.timble.net)
 * @license     GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
 * @link        http://www.joomlatools.com
 */

namespace Foliolabs\Docman;

use Foliolabs\Library;

class DatabaseTableDocuments extends Library\DatabaseTableAbstract
{
    protected function _initialize(Library\ObjectConfig $config)
    {
        $config->append([
            'behaviors' => [
                'lockable',
                'creatable',
                'modifiable',
                'sluggable',
                'identifiable',
                'hittable',
                'parameterizable',
                'invalidatable',
                'orderable',
                'routable',
                'com:docman.database.behavior.document.permissible',
                'com:docman.database.behavior.document.notifiable'
            ],
            'column_map' => [
                'parameters' => 'params',
                'touched_on' => 'GREATEST(tbl.created_on, tbl.modified_on)'
            ],
            'filters' => [
                'parameters'   => ['json'],
                'title'        => ['trim'],
                'storage_type' => ['com://admin/docman.filter.identifier'],
                'summary'      => ['com://admin/docman.filter.summary'],
                'description'  => ['trim', 'com:base.filter.html']
            ]
        ]);

        parent::_initialize($config);
    }
}
