protected function getBinary(File $file) { if ($this->cacheBinaries == true) { if (array_key_exists($file->getId(), $this->cachedBinaries)) { return $this->cachedBinaries[$file->getId()]; } $binary = $this->repository->getBinary($file); $this->cachedBinaries[$file->getId()] = $binary; } else { $binary = $this->repository->getBinary($file); } return $binary; }