<?php

    /**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */

    bx_import('BxDolCron');

    require_once('BxPommoModule.php');

    class BxPommoCron extends BxDolCron
    {
        var $oPommoObject;
        var $iDaysForRows;

        /**
         * Class constructor;
         */
        function BxPommoCron()
        {
            $this -> oPommoObject = BxDolModule::getInstance('BxPommoModule');
            $this -> iDaysForRows = $this -> oPommoObject -> _oConfig -> iDaysForRows;
        }

        /**
         * Function will delete all unnecessary events;
         */
        function processing()
        {
            if ($this -> iDaysForRows > 0) {
                $this -> oPommoObject -> _oDb -> deleteUselessData($this -> iDaysForRows);
            }
        }
    }
