Esempio n. 1
0
 /**
  * Find a file by it's name.
  *
  * @param                 $name
  * @param DiskInterface   $disk
  * @param FolderInterface $folder
  * @return null|FileInterface
  */
 public function findByName($name, DiskInterface $disk, FolderInterface $folder = null)
 {
     return $this->model->where('name', $name)->where('disk_id', $disk->getId())->where('folder_id', $folder ? $folder->getId() : null)->first();
 }
 /**
  * Find a folder by it's name and parent folder.
  *
  * @param                 $name
  * @param DiskInterface   $disk
  * @param FolderInterface $parent
  * @return null|FolderInterface
  */
 public function findByName($name, DiskInterface $disk, FolderInterface $parent = null)
 {
     return $this->model->where('name', $name)->where('disk_id', $disk->getId())->where('parent_id', $parent ? $parent->getId() : null)->first();
 }
Esempio n. 3
0
 /**
  * Find a file by it's name and folder.
  *
  * @param                 $name
  * @param FolderInterface $folder
  * @return null|FileInterface
  */
 public function findByNameAndFolder($name, FolderInterface $folder)
 {
     return $this->model->where('name', $name)->where('folder_id', $folder->getId())->first();
 }