getDirectoryId() public method

Get a directory ID, should it exist.
public getDirectoryId ( array $parts, string $cabin ) : integer
$parts array
$cabin string
return integer
Ejemplo n.º 1
0
 /**
  * Reduce code duplication
  *
  * @param string $path
  * @param string $cabin
  * @return array (array $publicPath, int|null $root)
  */
 protected function loadCommonData(string $path, string $cabin) : array
 {
     if (!$this->permCheck()) {
         \Airship\redirect($this->airship_cabin_prefix);
     }
     $root = null;
     $publicPath = \Airship\chunk($path);
     $pathInfo = $this->getPath($path);
     if (!empty($pathInfo)) {
         try {
             $root = $this->files->getDirectoryId($pathInfo, $cabin);
         } catch (FileNotFound $ex) {
             \Airship\redirect($this->airship_cabin_prefix);
         }
     }
     // return [$pathInfo, $publicPath, $root];
     return [$publicPath, $root];
 }