MetaModels\Helper\ToolboxFile::sortByDate PHP Method

sortByDate() protected method

Sort by modification time.
protected sortByDate ( boolean $blnAscending = true ) : array
$blnAscending boolean Flag to determine if sorting shall be applied ascending (default) or descending.
return array
    protected function sortByDate($blnAscending = true)
    {
        $arrFiles = $this->foundFiles;
        $arrDates = $this->modifiedTime;
        if (!$arrFiles) {
            return array('files' => array(), 'source' => array());
        }
        if ($blnAscending) {
            array_multisort($arrFiles, SORT_NUMERIC, $arrDates, SORT_ASC);
        } else {
            array_multisort($arrFiles, SORT_NUMERIC, $arrDates, SORT_DESC);
        }
        return $this->remapSorting($arrFiles, $this->outputBuffer);
    }