Create generic collection

@param  array  $data
@return Images
320178
public function createCollection(array $data = [])
    {
        $collection = new Images();

        foreach ($data as $item) {
            $collection->add(null, $this->create($item));
        }

        return $collection;
    }
214034
public static function createMultiple(array $data)
    {
        $items = [];

        foreach ($data as $action) {
            $items[] = new self($action);
        }

        return $items;
    }
483043
public static function createCollection(array $data)
    {
        $countries = array();
        foreach ($data as $countryIdentifier => $countryItem) {
            $languages = array();
            foreach ($countryItem['languages'] as $languageIdentifier => $languageItem) {
                $languages[] = new Language($languageIdentifier, $languageItem['locale'], $languageItem['expose']);
            }

            $countries[] = new Country($countryIdentifier, $countryItem['country'], $countryItem['continent'], new LanguageCollection($languages));
        }

        return new CountryCollection($countries);
    }
405144
public function create(array $data = [])
    {
        $collection = new Collection();

        if (array_key_exists('parts', $data)) {
            $collection->setParts(
                $this->getMovieFactory()->createCollection($data['parts'])
            );
        }

        if (array_key_exists('backdrop_path', $data)) {
            $collection->setBackdropImage(
                $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
            );
        }

        if (array_key_exists('images', $data)) {
            $collection->setImages(
                $this->getImageFactory()->createCollectionFromMovie($data['images'])
            );
        }

        if (array_key_exists('poster_path', $data)) {
            $collection->setPosterImage(
                $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
            );
        }

        return $this->hydrate($collection, $data);
    }
1260074
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);

        foreach ($data as $key => $value) {
            if ($key === 'format') {
                $type->setFormat($value);
            }
        }

        return $type;
    }
300016
public function createCollection(array $data, array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->create($data);
        $this->checkResponse($rs);
        unset($rs['_curl_info']);

        return $rs;
    }
1216289
public function fromArray($data)
    {
        if (empty($data)) {
            return $this;
        }
        if (isset($data['type']) && $data['type']) {
            $this->setType($data['type']);
        }
        if (isset($data[$this->getType()]) && $data[$this->getType()]) {
            $this->setValue($data[$this->getType()]);
        }
        return $this;
    }
1073315
public function create(array $data = [])
    {
        $listItem = new ListItem();

        /** Images */
        if (array_key_exists('backdrop_path', $data)) {
            $listItem->setBackdropImage(
                $this->getImageFactory()->createFromPath($data['backdrop_path'], 'backdrop_path')
            );
        }

        if (array_key_exists('poster_path', $data)) {
            $listItem->setPosterImage(
                $this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path')
            );
        }

        return $this->hydrate($listItem, $data);
    }
1094535
public function create($data)
    {
        $descriptor = new ThrowsDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setTypes(
            $this->builder->buildDescriptor(new Collection($data->getTypes()))
        );

        return $descriptor;
    }
1103266
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $searchResult) {
            $self->addSearchResult(KeySearchResult::createFromArray($searchResult));
        }

        return $self;
    }
1085833
public function create($data)
    {
        $descriptor = new VarDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setVariableName($data->getVariableName());

        $types = $this->builder->buildDescriptor(
            new Collection($data->getVariableName() == '$this' ? array('$this') : $data->getTypes())
        );
        $descriptor->setTypes($types);

        return $descriptor;
    }
258094
static public function createFromArray(array $data)
    {
        if (4 != count($data)) {
            throw new InvalidArgumentException("Expected data as a 4 length array.");
        }

        $filter = new static($data[0], $data[1]);
        $filter->setOperator($data[2]);
        $filter->setValue(unserialize($data[3]));

        return $filter;
    }
1088635
public function newEntityCollection(array $data): array {
		if (empty($this->entityType)) {
			throw new EntityFactoryException("Cannot produce entity without type.", EntityFactoryException::UNSET_ENTITY_TYPE);
		}
		
		$entities = [];
		foreach ($data as $datum) {
			$entities[] = $this->newEntity($datum);
		}
		
		return $entities;
	}
1144418
public function create( $data )
	{
		$record = $this->fill( $data );

		if( is_array($record) )
		{
			$this->collection()->insert($record);
		}

		return $record;
	}
257947
public function merge($data) : Collection
    {
        return static::create(array_merge($this->data, $this->convertToArray($data)));
    }
1300079
public static function createFromArray($data)
    {
        switch (true)
        {
            case $data['html'] != '':
                return new Banners_Banner_Text($data);
            case preg_match('/\.swf$/i', $data['image']):
                return new Banners_Banner_Flash($data);
            default:
                return new Banners_Banner_Image($data);
        }
    }
493043
protected function createFilter(array $data = null)
    {
        $filter = new static();
        if ($data !== null) {
            $filter->setData($data);
        }
        return $filter;
    }