/** * @param FileReportModel $file1 * @param FileReportModel $file2 * * @return bool */ private function fileDateComparison(FileReportModel $file1, FileReportModel $file2) { if ($file1->getCreationDate() === $file2->getCreationDate()) { return 0; } $time1 = $file1->getCreationDate()->getTimestamp(); $time2 = $file2->getCreationDate()->getTimestamp(); return $time1 < $time2 ? -1 : 1; }
/** * @return array */ private function convertRealObjectToRawResponse(FileReportModel $file) { return ['type' => 'file', 'timestamp' => $file->getCreationDate()->getTimestamp(), 'path' => $file->getFilename(), 'size' => $file->getSize()]; }