Phulp\Collection::getType PHP Метод

getType() публичный Метод

Returns which is the type of the elements.
public getType ( ) : string
Результат string
    public function getType()
    {
        return $this->type;
    }

Usage Example

Пример #1
0
 /**
  * Gets the value of distFiles.
  *
  * @param Collection|DistFile[] $distFiles
  *
  * @throws \UnexpectedValueException
  */
 public function setDistFiles(Collection $distFiles)
 {
     if ($distFiles->getType() !== DistFile::class) {
         throw new \UnexpectedValueException('The Collection is not of DistFile type');
     }
     $this->distFiles = $distFiles;
 }