public function addCollection(MetadataCollection $collection) { foreach ($collection->getMetadatas() as $metadata) { $this->addMetadata($metadata); } foreach ($collection->getResources() as $resource) { $this->addResource($resource); } }
/** * Parses all bot metadatas * * @param $content * @return array */ private function parseBots(MetadataCollection $collection, $content) { if (!isset($content['bots'])) { return; } foreach ($content['bots'] as $name => $bot) { $ip = isset($bot['ip']) ? $bot['ip'] : null; $metadata = new Metadata($name, $bot['agent'], $ip); if (isset($bot['type'])) { $metadata->setType($bot['type']); } if (isset($bot['meta'])) { $metadata->setMeta($bot['meta']); } if (isset($bot['agent_match'])) { $metadata->setAgentMatch($bot['agent_match']); } $collection->addMetadata($metadata); } }