Hydrate a collection of profile objects into a collection of
ProfileEntity objects

@param stdClass[] $profiles
@return ProfileEntity[]
194857
public static function hydrateCollection(array $profiles)
    {
        $hydrated = [];

        foreach ($profiles as $profile) {
            $hydrated[] = self::hydrate($profile);
        }

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

        foreach ($callbacks as $callback) {
            $hydrated[] = self::hydrate($callback);
        }

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

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

        return $hydrated;
    }
8474
public function removeAll()
    {
        foreach ($this->getProfiles() as $profile => $child) {
            $this->remove($profile);
        }

        return $this;
    }
1136420
protected function hydrateRelationSaveValue($names)
    {
        if (!$names) {
            return $names;
        }

        $relationModel = $this->getRelationModel();
        $existingTags = $relationModel
            ->whereIn($this->nameFrom, $names)
            ->lists($this->nameFrom, $relationModel->getKeyName())
        ;

        $newTags = $this->customTags ? array_diff($names, $existingTags) : [];

        foreach ($newTags as $newTag) {
            $newModel = $relationModel::create([$this->nameFrom => $newTag]);
            $existingTags[$newModel->getKey()] = $newTag;
        }

        return array_keys($existingTags);
    }
442395
public function toProfiles($profiles, $horn)
	{
		$horn = array_merge(['profile_uids' => $profiles], $horn);

		return $this->request->send('POST', "/profiles/horns", $horn);
	}
424584
public static function hydrateCollection(array $contexts)
    {
        $hydrated = [];

        foreach ($contexts as $context) {
            $hydrated[] = self::hydrate($context);
        }

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

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

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

        foreach ($controllers as $controller) {
            $hydrated[] = self::hydrate($controller);
        }

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

        foreach ($libraries as $library) {
            $hydrated[] = self::hydrate($library);
        }

        return $hydrated;
    }
1346692
public function getClasses($items)
  {
    $result = [];
    foreach ($items as $item) {
      $result[] = new ClassEntity($item);
    }

    return $result;
  }
1340913
protected function loadEntities(array $entityIds)
    {
        if (count($entityIds) === 0) {
            return null;
        }

        $entities = [];

        // Create and store the entities associated with each Id
        foreach ($entityIds as $entityId) {
            $hash = $this->getEntityHashById($entityId);

            if ($hash === null) {
                return null;
            }

            $entities[] = $this->loadEntity($hash);
        }

        return $entities;
    }
1357947
public static function hydrateCollection(array $settings)
    {
        $hydrated = [];

        foreach ($settings as $setting) {
            $hydrated[] = self::hydrate($setting);
        }

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

        foreach ($scans as $scan) {
            $hydrated[] = self::hydrate($scan);
        }

        return $hydrated;
    }
1055025
public function saveProfile(Profile $profile)
    {
        // late collect
        foreach ($profile->getCollectors() as $collector) {
            if ($collector instanceof LateDataCollectorInterface) {
                $collector->lateCollect();
            }
        }

        if (!($ret = $this->storage->write($profile)) && null !== $this->logger) {
            $this->logger->warning('Unable to store the profiler information.', ['configured_storage' => \get_class($this->storage)]);
        }

        return $ret;
    }
70962
public function getAllInstances()
    {
        $cacheId = CacheId::pluginAware('ProfileSummaries');
        $cache   = Cache::getTransientCache();

        if (!$cache->contains($cacheId)) {
            $instances = [];

            /**
             * Triggered to add new live profile summaries.
             *
             * **Example**
             *
             *     public function addProfileSummary(&$profileSummaries)
             *     {
             *         $profileSummaries[] = new MyCustomProfileSummary();
             *     }
             *
             * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries
             */
            Piwik::postEvent('Live.addProfileSummaries', array(&$instances));

            foreach ($this->getAllProfileSummaryClasses() as $className) {
                $instances[] = new $className();
            }

            /**
             * Triggered to filter / restrict profile summaries.
             *
             * **Example**
             *
             *     public function filterProfileSummary(&$profileSummaries)
             *     {
             *         foreach ($profileSummaries as $index => $profileSummary) {
             *              if ($profileSummary->getId() === 'myid') {}
             *                  unset($profileSummaries[$index]); // remove all summaries having this ID
             *              }
             *         }
             *     }
             *
             * @param ProfileSummaryAbstract[] $profileSummaries An array of profile summaries
             */
            Piwik::postEvent('Live.filterProfileSummaries', array(&$instances));

            $cache->save($cacheId, $instances);
        }

        return $cache->fetch($cacheId);
    }
299792
public static function hydrateCollection(array $clients)
    {
        $hydrated = [];

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

        return $hydrated;
    }