<?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 DatabaseBehaviorDocumentNotifiable extends DatabaseBehaviorNotifiable
{
    protected function _getEntity(Library\DatabaseContextInterface $context = null)
    {
        if (($entity = parent::_getEntity($context))) {
            $entity = $entity->category;
        }

        return $entity;
    }

    protected function _getTable()
    {
        return $this->getObject('com:docman.database.table.categories');
    }

    protected function _afterDelete(Library\DatabaseContextInterface $context)
    {
        // Do nothing
    }
}