Prado\Util\TLogger::deleteLogs PHP Метод

deleteLogs() публичный Метод

Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp. A level filter is specified by an integer, whose bits indicate the levels interested. For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels. A category filter is specified by an array of categories to filter. A message whose category name starts with any filtering category will be deleted. For example, a category filter array('System.Web','System.IO') will delete messages under categories such as 'System.Web', 'System.IO', 'System.Web.UI', 'System.Web.UI.WebControls', etc. A control client id filter is specified by an array of control client id A message whose control client id starts with any filtering naming panels will be deleted. For example, a category filter array('ctl0_body_header', 'ctl0_body_content_sidebar') will delete messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar', 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc. A timestamp filter is specified as an interger or float number. A message whose registered timestamp is less or equal the filter value will be returned. Level filter, category filter, control filter and timestamp filter are combinational, i.e., only messages satisfying all filter conditions will they be returned.
public deleteLogs ( $levels = null, $categories = null, $controls = null, $timestamp = null )
    public function deleteLogs($levels = null, $categories = null, $controls = null, $timestamp = null)
    {
        $this->_levels = $levels;
        $this->_categories = $categories;
        $this->_controls = $controls;
        $this->_timestamp = $timestamp;
        if (empty($levels) && empty($categories) && empty($controls) && is_null($timestamp)) {
            $this->_logs = array();
            return;
        }
        $logs = $this->_logs;
        if (!empty($levels)) {
            $logs = array_filter(array_filter($logs, array($this, 'filterByLevels')));
        }
        if (!empty($categories)) {
            $logs = array_filter(array_filter($logs, array($this, 'filterByCategories')));
        }
        if (!empty($controls)) {
            $logs = array_filter(array_filter($logs, array($this, 'filterByControl')));
        }
        if (!is_null($timestamp)) {
            $logs = array_filter(array_filter($logs, array($this, 'filterByTimeStamp')));
        }
        $this->_logs = array_values(array_diff_key($this->_logs, $logs));
    }