Make multiple objects using the container.

@param string [] $classes

@return object[]
761718
protected function make( array $classes )
	{
		foreach ( $classes as $index => $class )
			try
			{
				$classes[$index] = UniversalBuilder::resolveClass( $class, true );
			}
			catch ( Exception $e )
			{
				unset( $classes[$index] );
				$this->report( $e );
			}

		return array_values( $classes );
	}
653332
public final function toClass(string $class): ?array
    {
        $data = null;
        if (!empty($this->data)) {
            $data = $this->data;
            foreach ($data as &$dat) {
                $datClass = new $class();
                foreach ((array) $dat as $key => $value) {
                    $datClass->{$key} = $value;
                }
                $dat = $datClass;
            }
        }

        return $data;
    }
592528
public function createSchema(array $classes)
    {
        $createSchemaSql = $this->getCreateSchemaSql($classes);
        $conn            = $this->em->getConnection();

        foreach ($createSchemaSql as $sql) {
            try {
                $conn->executeQuery($sql);
            } catch (Throwable $e) {
                throw ToolsException::schemaToolFailure($sql, $e);
            }
        }
    }
403251
private function buildSubjects(array $objects)
    {
        $subjects = [];

        foreach ($objects as $object) {
            $subject = SubjectIdentity::fromObject($object);
            $id = SharingUtils::getCacheId($subject);

            if (!\array_key_exists($id, $this->cacheSubjectSharing)
                    && $this->hasIdentityPermissible()
                    && $this->hasSharingVisibility($subject)
                    && $this->hasSubjectConfig($subject->getType())) {
                $subjects[$id] = $subject;
                $this->cacheSubjectSharing[$id] = false;
            }
        }

        return $subjects;
    }
1118012
static public function from($class)
        {
            if (is_object($class)) {
                $class = get_class($class);
            }

            if (empty(self::$prototypes[$class])) {
                self::$prototypes[$class] = new static($class);
            }

            return self::$prototypes[$class];
        }
962218
public function hasAnyClass($classes, array $options)
    {
        $options += ['class' => []];

        $options['class'] = $this->_toClassArray($options['class']);
        $classes = $this->_toClassArray($classes);

        foreach ($classes as $class) {
            if (in_array($class, $options['class'])) {
                return true;
            }
        }

        return false;
    }
346210
public function mutate($objects)
	{
		$objects = call_user_func_array(array($this, 'flattenArguments'), func_get_args());
		$collect = [];

		foreach ($objects as $obj) {
			if ($obj instanceof AbstractGenerator) {
				array_push($collect, $obj);
				continue;
			}

			throw new InvalidArgumentException(sprintf('Mutable objects must be instances of %s.', AbstractGenerator::class));
		}
		
		$this->mutates = array_merge(static::objectDiffInArrays($this->mutates, $collect), $collect);
		
		return $this;
	}
1089078
private static function cleanClasses(array $classes): array
  {
    $ret = [];

    foreach ($classes as $class)
    {
      $tmp = Cast::toManString($class, '');
      if ($tmp!=='') $ret[] = $tmp;
    }

    return array_unique($ret);
  }
947798
public function addClasses(string ...$classes): self
    {
        $this->classes = array_unique(array_merge($this->classes, $classes));

        return $this;
    }
587340
public function create($data, $class)
    {
        return is_object($data) ? $data : $this->hydrate(is_array($data) ? $data : [$data], $class);
    }
120828
private function loadClassTraits(array $classes)
    {
        $hierarchy = [];

        foreach ($classes as $class) {
            $traits = $this->loadTraits($class->getTraits());

            // Reverse the order of the traits list, (deepest becomes first as later traits overwrite).
            // And add them before the class (class overwrites traits).
            $hierarchy = array_merge($hierarchy, array_reverse($traits));
            $hierarchy[] = $class->name;
        }

        return $hierarchy;
    }
1026837
public function attachPearPrefixes(array $classes)
    {
        foreach ($classes as $prefix => $paths) {
            $this->attachPearPrefix($prefix, $paths);
        }
        return $this;
    }
1152071
public function make(array $attributes = [])
    {
        if ($this->amount === null) {
            return $this->makeInstance($attributes);
        }

        if ($this->amount < 1) {
            return (new $this->class)->newCollection();
        }

        return (new $this->class)->newCollection(array_map(function () use ($attributes) {
            return $this->makeInstance($attributes);
        }, range(1, $this->amount)));
    }
286422
public function findMultiple($classes = [], $interfaces = [], $traits = []) {
        $this->init();

        $classes    = $this->normalizeArray($classes);
        $interfaces = $this->normalizeArray($interfaces);
        $traits     = $this->normalizeArray($traits);

        $foundClasses = [];

        if ($classes !== false) {
            foreach ($classes as $class) {
                $foundClasses = array_merge($foundClasses, $this->findExtends($class));
            }
        }

        if ($interfaces !== false) {
            foreach ($interfaces as $interface) {
                $foundClasses = array_merge($foundClasses, $this->findImplements($interface));
            }
        }

        if ($traits !== false) {
            foreach ($traits as $trait) {
                $foundClasses = array_merge($foundClasses, $this->findTraitUse($trait));
            }
        }

        return $this->arrayUniqueObject($foundClasses);
    }
931194
public static function makeCollection($rows)
    {
        $collection = [];
        foreach ($rows as $row)
        {
            $obj = new static;
            $collection[] = $obj->setAttributes(get_object_vars($row));
        }
        return $collection;
    }
368993
public function setClasses($classes)
    {
        if (!is_array($classes)) {
            $classes = $classes ? array($classes) : array();
        }
        $this->modelClasses = $classes;
    }
712559
public static function toObjectArray(array $items, $class, UserContext $context)
    {
        return array_combine($items, array_map(function ($item) use ($class, $context) {
            return new $class($item, $context);
        }, $items));
    }