public function getPortalInformations($environment, $types = null)
{
if (!isset($this->portalInformations[$environment])) {
throw new \InvalidArgumentException(sprintf('Unknown portal environment "%s"', $environment));
}
if ($types === null) {
return $this->portalInformations[$environment];
}
return array_filter($this->portalInformations[$environment], function (PortalInformation $portalInformation) use($types) {
return in_array($portalInformation->getType(), $types);
});
}