public function Check($value)
    {
        $this->error = '';
        if ($this->currentFile && $value == $this->currentFile)
        {
            return true;
        }
        if (!Folder::Exists($this->folder))
        {
            return true;
        }
        $files = Folder::GetFiles($this->folder);
        if ($this->fileExtension)
        {
            $value = Path::AddExtension($value, $this->fileExtension);
        }
        if (in_array($value, $files))
        {
            $this->error = self::ExistsInFolder;
        }
        return $this->error == '';
    }
public function Check($value)
    {
        $this->error = '';
        if ($this->currentFile && $value == $this->currentFile)
        {
            return true;
        }
        if (!Folder::Exists($this->folder))
        {
            return true;
        }
        $files = Folder::GetFiles($this->folder);
        if ($this->fileExtension)
        {
            $value = Path::AddExtension($value, $this->fileExtension);
        }
        if (in_array($value, $files))
        {
            $this->error = self::ExistsInFolder;
        }
        return $this->error == '';
    }
public function Check ( $ value ) { $ this -> error = '' ; if ( $ this -> currentFile && $ value == $ this -> currentFile ) { return true ; } if ( ! Folder :: Exists ( $ this -> folder ) ) { return true ; } $ files = Folder :: GetFiles ( $ this -> folder ) ; if ( $ this -> fileExtension ) { $ value = Path :: AddExtension ( $ value , $ this -> fileExtension ) ; } if ( in_array ( $ value , $ files ) ) { $ this -> error = self :: ExistsInFolder ; } return $ this -> error == '' ; }
Checks if the file given in the value doesn't exist yet
@param string $value The value to check
@return boolean True id check passed
Checks if the file given in the value doesn t exist yet