CrawlJob.php
/**
     * Factory method for creating a job.
     *
     * @param \PhpAmqpLib\Message\AMQPMessage $message
     * @return \Simgroep\ConcurrentSpiderBundle\CrawlJob
     */
Factory method for creating a job.
Factory method for creating a job .
public static function create(AMQPMessage $message)
    {
        $data = json_decode($message->body, true);
        $urlToCrawl = $data['url'];
        $baseUrl = $data['base_url'];
        $blacklist = $data['blacklist'];
        $metadata = $data['metadata'];
        $whitelist = $data['whitelist'];
        $queueName = $data['queueName'];
        return new self($urlToCrawl, $baseUrl, $blacklist, $metadata, $whitelist, $queueName);
    }
public static function create ( AMQPMessage $ message ) { $ data = json_decode ( $ message -> body , true ) ; $ urlToCrawl = $ data [ 'url' ] ; $ baseUrl = $ data [ 'base_url' ] ; $ blacklist = $ data [ 'blacklist' ] ; $ metadata = $ data [ 'metadata' ] ; $ whitelist = $ data [ 'whitelist' ] ; $ queueName = $ data [ 'queueName' ] ; return new self ( $ urlToCrawl , $ baseUrl , $ blacklist , $ metadata , $ whitelist , $ queueName ) ; }
Factory method for creating a job.
Factory method for creating a job .