예제 #1
0
 /**
  * Return a new collection of media, given the native type.
  * @param $type string (image,document,vector...)
  * @return MediaCollection
  */
 public function byType($type)
 {
     $collection = new MediaCollection();
     foreach ($this->items as $media) {
         if ($media->nativeType() == strtolower($type)) {
             $collection->add($media);
         }
     }
     return $collection;
 }