Add files to the folder.

@param Collection $files

@return static

@throws FileException
@throws FolderException
516859
public function addFiles(Collection $files): self
    {
        foreach ($files as $file) {
            $this->addFile($file);
        }

        return $this;
    }
408645
public function setFiles(array $files) {
        if(!$this->setModified('files', $files)->isModified()) {
            return $this;
        }
		$this->files = $files;
		return $this;
    }
406592
public function add($items)
    {
        if ($items && $items instanceof \Purekid\Mongodm\Model) {
            $id = (string) $items->getId();
            $this->_items[$id] = $items;
        } elseif (is_array($items)) {
            foreach ($items as $obj) {
                if ($obj instanceof \Purekid\Mongodm\Model) {
                    $this->add($obj);
                }
            }
        } elseif ($items instanceof self) {
            $this->add($items->toArray());
        }

        return $this;

    }
1107154
public static function addJsFiles($files = array())
    {
        
		foreach($files as $file){
			self::addFile($file, tao_helpers_Scriptloader::JS);
		}
        
    }
114274
public function setFileData(array $files)
    {
        $files = $this->deflateFilesArray($files);

        $this->fileUploads = [];

        foreach ($files as $key => $fileData) {
            $uploadObj = FileUpload::createFromFileArray($fileData);

            if (!empty($uploadObj)) {
                $this->fileUploads[$key] = $uploadObj;
            }
        }

        return $this;
    }
635893
public function addFile($file, $fileInfo)
    {
        if (!($fileInfo instanceof \SplFileInfo)) {
            $fileInfo = new \SplFileInfo($fileInfo);
        }

        $this->files[$file] = $fileInfo;

        try {
            $mTime = $fileInfo->getMTime();
        } catch (\Exception $e) {
            $mTime = 0;
        }

        if ($mTime > $this->maxMTime) {
            $this->maxMTime = $mTime;
        }

        return $this;
    }
684751
public function files(FileCollection $files)
    {
        foreach ($files as $key => $file) {
            $this->getReporter()->progress($key + 1, count($files));

            foreach ($this->getReviews()->forFile($file) as $review) {
                $review->review($this->getReporter(), $file);
            }
        }

        return $this;
    }
83894
public function add( ...$items )
	{
		foreach ( $items as &$item ) $item = (array)$item;
		$this->items = array_merge( $this->items , ...$items );
		return $this;
	}
45790
public function addDirs($dirs) {
        if(!is_array($dirs)) {
            $dirs = array($dirs);
        }

        $this->dirs = array_merge($this->dirs, $dirs);
    }
58575
public function addStylesheet($files)
    {
        $files = array_filter((array) $files);

        foreach ($files as $v) {
            if ($v instanceof DomDocument) {
                $this->styles[] = $v;
            } elseif (!is_string($v) || in_array($v, $this->styles, true)) {
                return;
            } elseif (is_string($v)) {
                $this->styles[] = $v;
            }
        }
    }
1296845
public function insertFile($file)
    {
        if ( ! $this->checkedIndexes) {
            $this->ensureIndexes();
        }

        $this->filesCollection->insertOne($file);
    }
271622
public function addFiles(array $files)
    {
        $added_files = 0;
        try {
            foreach ($files as $localName => $filename) {
                if (!is_null($filename)) {
                    $this->sevenZip->addEntry($filename);
                    $this->sevenZip->renameEntry($filename, $localName);
                    $added_files++;
                }
            }
        } catch (Exception $e) {
            throw new Exception('Could not modify archive: '.$e->getMessage(), $e->getCode(), $e);
        }
        return $added_files;
    }
1333918
public static void addFilesRecursively(File dir, Collection<File> fileCollection) {
		log.debug("Adding files from {}", dir.getPath());
		File[] files = dir.listFiles();
		for (File file : files) {
			if (file.isDirectory())
				addFilesRecursively(file, fileCollection);
			else {
				fileCollection.add(file);
			}
		}
	}
187017
public function add($documents)
    {

        $pendingRemove = $this->getRemove();
        if ($this->getRemove()) {
            if ($this->all()) {
                throw new \RuntimeException('Adding to group with pending remove is not permitted');
            } else {
                $this->clearAdd();
                $this->clearRemove();
                $this->saved = array();
            }
        }
        if (!is_array($documents)) {
            $documents = array($documents);
        }

        $add =& $this->getArchive()->getByRef('add', array());
        foreach ($documents as $document) {
            $add[] = $document;
        }
    }
347348
protected function getFiles(array $files)
    {
        $filesEntity = [];

        foreach ($files as $file) {
            $filesEntity[] = new File($file);
        }

        return $filesEntity;
    }
641873
public function setMerged(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                if (is_array($_file) && isset($_file['file'])) {
                    if (isset($_file['media'])) {
                        $this->add($_file['file'], $_file['media']);
                    } else {
                        $this->add($_file['file']);
                    }
                } elseif (is_string($_file)) {
                    $this->add($_file);
                }
            }
        }
        return $this;
    }
208985
function setFiles($files)
    {
        $this->files = \Poirot\Http\Psr\normalizeFiles($files);
        return $this;
    }