/** * * @param Model\Bot $bot * @param \WhichBrowser\Browser $browserRaw */ private function hydrateBot(Model\Bot $bot, \WhichBrowser\Browser $browserRaw) { $bot->setIsBot(true); if ($this->isRealResult($browserRaw->getName()) === true) { $bot->setName($browserRaw->getName()); } }
/** * * @param Model\Bot $bot * @param array $resultRaw */ private function hydrateBot(Model\Bot $bot, array $resultRaw) { $bot->setIsBot(true); if (isset($resultRaw['name']) && $this->isRealResult($resultRaw['name']) === true) { $bot->setName($resultRaw['name']); } }
/** * * @param Model\Bot $bot * @param array|boolean $botRaw */ private function hydrateBot(Model\Bot $bot, $botRaw) { $bot->setIsBot(true); if (isset($botRaw['name']) && $this->isRealResult($botRaw['name'])) { $bot->setName($botRaw['name']); } if (isset($botRaw['category']) && $this->isRealResult($botRaw['category'])) { $bot->setType($botRaw['category']); } }
/** * * @param Model\Bot $bot * @param \UAParser\Result\Client $resultRaw */ private function hydrateBot(Model\Bot $bot, \UAParser\Result\Client $resultRaw) { $bot->setIsBot(true); if ($this->isRealResult($resultRaw->ua->family) === true) { $bot->setName($resultRaw->ua->family); } }
public function testToArray() { $bot = new Bot(); $this->assertEquals(['isBot' => null, 'name' => null, 'type' => null], $bot->toArray()); $bot->setIsBot(true); $bot->setName('my bot name2'); $bot->setType('backlink'); $this->assertEquals(['isBot' => true, 'name' => 'my bot name2', 'type' => 'backlink'], $bot->toArray()); }
/** * * @param Model\Bot $bot * @param stdClass $resultRaw */ private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) { $bot->setIsBot(true); if (isset($resultRaw->browser)) { $bot->setName($this->getRealResult($resultRaw->browser, 'bot', 'name')); } if (isset($resultRaw->issyndicationreader) && $resultRaw->issyndicationreader === true) { $bot->setType('RSS'); } elseif (isset($resultRaw->browser_type)) { $bot->setType($this->getRealResult($resultRaw->browser_type)); } }
/** * * @param Model\Bot $bot * @param stdClass $resultRaw */ private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) { $bot->setIsBot(true); }
/** * * @param Model\Bot $bot * @param stdClass $resultRaw */ private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) { $bot->setIsBot(true); if (isset($resultRaw->browser_name)) { $bot->setName($this->getRealResult($resultRaw->browser_name)); } if (isset($resultRaw->software_sub_type)) { $bot->setType($this->getRealResult($resultRaw->software_sub_type)); } }
/** * * @param Model\Bot $bot * @param array $resultRaw */ private function hydrateBot(Model\Bot $bot, array $resultRaw) { $bot->setIsBot(true); $bot->setName($this->getRealResult($resultRaw['botName'])); }
/** * * @param Model\Bot $bot * @param stdClass $resultRaw */ private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) { $bot->setIsBot(true); if (isset($resultRaw->ua_family)) { $bot->setName($this->getRealResult($resultRaw->ua_family)); } }
/** * * @param Model\Bot $bot * @param \UAParser\Result\Client $resultRaw */ private function hydrateBot(Model\Bot $bot, \UAParser\Result\Client $resultRaw) { $bot->setIsBot(true); $bot->setName($this->getRealResult($resultRaw->ua->family, 'bot', 'name')); }
/** * * @param Model\Bot $bot * @param EndorphinDetector\Robot $resultRaw */ private function hydrateBot(Model\Bot $bot, EndorphinDetector\Robot $resultRaw) { $bot->setIsBot(true); $bot->setName($this->getRealResult($resultRaw->getName())); $bot->setType($this->getRealResult($resultRaw->getType())); }
/** * * @param Model\Bot $bot * @param stdClass $resultRaw */ private function hydrateBot(Model\Bot $bot, stdClass $resultRaw) { $bot->setIsBot(true); if (isset($resultRaw->browser) && $this->isRealResult($resultRaw->browser) === true) { $bot->setName($resultRaw->browser); } // @todo convert to a common set of types (over all vendors) if (isset($resultRaw->issyndicationreader) && $resultRaw->issyndicationreader === true) { $bot->setType('RSS'); } elseif (isset($resultRaw->browser_type) && $resultRaw->browser_type === 'Bot/Crawler') { $bot->setType('Crawler'); } elseif (isset($resultRaw->browser_type) && $this->isRealResult($resultRaw->browser_type) === true) { $bot->setType($resultRaw->browser_type); } }