Hydrate a collection of activity objects into a collection of
ActivityEntity objects

@param stdClass[] $activities
@return ActivityEntity[]
778048
public static function hydrateCollection(array $activities)
    {
        $hydrated = [];

        foreach ($activities as $activity) {
            $hydrated[] = self::hydrate($activity);
        }

        return $hydrated;
    }
352935
public static function hydrateCollection(array $licenses)
    {
        $hydrated = [];

        foreach ($licenses as $license) {
            $hydrated[] = self::hydrate($license);
        }

        return $hydrated;
    }
616226
public static function hydrate(stdClass $context)
    {
        $hydrated = new ContextEntity();

        if (isset($context->id)) {
            $hydrated->setId($context->id);
        }

        if (isset($context->parts)) {
            $hydrated->setParts(PartHydrator::hydrateCollection($context->parts));
        }

        return $hydrated;
    }
842928
public static function hydrateCollection(array $quotas)
    {
        $hydrated = [];

        foreach ($quotas as $quota) {
            $hydrated[] = self::hydrate($quota);
        }

        return $hydrated;
    }
281113
public static function hydrateCollection(array $comments)
    {
        $hydrated = [];

        foreach ($comments as $comment) {
            $hydrated[] = self::hydrate($comment);
        }

        return $hydrated;
    }
1220530
public static function hydrateCollection(array $parts)
    {
        $hydrated = [];

        foreach ($parts as $part) {
            $hydrated[] = self::hydrate($part);
        }

        return $hydrated;
    }
268641
public static function hydrateCollection(array $entrypoints)
    {
        $hydrated = [];

        foreach ($entrypoints as $entrypoint) {
            $hydrated[] = self::hydrate($entrypoint);
        }

        return $hydrated;
    }
420229
public static function hydrateCollection(array $reviews)
    {
        $hydrated = [];

        foreach ($reviews as $review) {
            $hydrated[] = self::hydrate($review);
        }

        return $hydrated;
    }
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;
    }
902915
public function addActivity(\CampaignChain\CoreBundle\Entity\ActivityModule $activities)
    {
        $this->activities[] = $activities;

        return $this;
    }
1114517
public static function hydrateCollection(array $customClasses)
    {
        $hydrated = [];

        foreach ($customClasses as $customClass) {
            $hydrated[] = self::hydrate($customClass);
        }

        return $hydrated;
    }
299792
public static function hydrateCollection(array $clients)
    {
        $hydrated = [];

        foreach ($clients as $client) {
            $hydrated[] = self::hydrate($client);
        }

        return $hydrated;
    }
65725
public function getRepositories(array $entityNames)
    {
        $repositoryCollection = new EntityRepositoryCollection($this);
        foreach ($entityNames as $entityName) {
            $repositoryCollection->addRepository($this->getRepository($entityName));
        }
        return $repositoryCollection;
    }
941573
public static function hydrateCollection(array $files)
    {
        $hydrated = [];

        foreach ($files as $file) {
            $hydrated[] = self::hydrate($file);
        }

        return $hydrated;
    }
1239208
public static function createFromObjects(array $objects = null)
    {
        if ($objects === null) {
            return null;
        }

        $collection = new static();

        foreach ($objects as $v) {
            if (!($v instanceof Contact) && ($v instanceof stdClass)) {
                $part = new Contact();
                $part->updateFromObject($v);
            }

            $collection->add($v);
        }

        return $collection;
    }
642290
public static function hydrate(stdClass $extension)
    {
        $hydrated = new ExtensionEntity();

        if (isset($extension->id)) {
            $hydrated->setId($extension->id);
        }

        if (isset($extension->extension)) {
            $hydrated->setExtension($extension->extension);
        }

        return $hydrated;
    }
568904
public function hydrate(PDOStatement $results) {

    if (method_exists($this, 'preHydrate')) {
      $results = $this->preHydrate($results);
    }

    $return = array();

    if ($results) {
      $arrayResults = $results->fetchAll();
      foreach ($arrayResults as $arrayResult) {
        $className = get_class($this);
        $object = new $className();
        $return[$arrayResult[$this->id_name]] = $object->setRecord($arrayResult);
      }
    }

    if (method_exists($this, 'postHydrate')) {
      $return = $this->preHydrate($return);
    }

    return $return;
  }