/** * Create an array containing only the available urlqueue property values. * * @param \Searchperience\Api\Client\Domain\UrlQueueItem\UrlQueueItem $urlQueue * @return array */ protected function buildRequestArray(\Searchperience\Api\Client\Domain\AbstractEntity $urlQueue) { $valueArray = array(); if (!is_null($urlQueue->getDeleted()) && !$urlQueue->getDeleted()) { $valueArray['deleted'] = 0; } if (!is_null($urlQueue->getDocumentId())) { $valueArray['documentId'] = $urlQueue->getDocumentId(); } //only reset allowed if (!is_null($urlQueue->getFailCount()) && $urlQueue->getFailCount() == 0) { $valueArray['failCount'] = $urlQueue->getFailCount(); } if (!is_null($urlQueue->getPriority())) { $valueArray['priority'] = $urlQueue->getPriority(); } if (!is_null($urlQueue->getUrl())) { $valueArray['url'] = $urlQueue->getUrl(); } // documentId is readonly and will not be persistet // lastError is readonly and will not be persistet // processingStartTime is readonly and will not be persistet // processingThreadId is readonly and will not be persistet return $valueArray; }
/** * Create an array containing only the available document property values. * * @param \Searchperience\Api\Client\Domain\Document\Document $document * @return array */ protected function buildRequestArray(\Searchperience\Api\Client\Domain\AbstractEntity $document) { $valueArray = array(); if ($document->getLastProcessingDate() instanceof \DateTime) { $valueArray['lastProcessing'] = $this->dateTimeService->getDateStringFromDateTime($document->getLastProcessingDate()); } if (!is_null($document->getBoostFactor())) { $valueArray['boostFactor'] = $document->getBoostFactor(); } if (!is_null($document->getIsProminent())) { $valueArray['isProminent'] = $document->getIsProminent(); } if (!is_null($document->getIsMarkedForProcessing())) { $valueArray['isMarkedForProcessing'] = $document->getIsMarkedForProcessing(); } if (!is_null($document->getIsMarkedForDeletion())) { $valueArray['isMarkedForDeletion'] = $document->getIsMarkedForDeletion(); } if (!is_null($document->getNoIndex())) { $valueArray['noIndex'] = $document->getNoIndex(); } if (!is_null($document->getForeignId())) { $valueArray['foreignId'] = $document->getForeignId(); } if (!is_null($document->getUrl())) { $valueArray['url'] = $document->getUrl(); } if (!is_null($document->getSource())) { $valueArray['source'] = $document->getSource(); } if (!is_null($document->getMimeType())) { $valueArray['mimeType'] = $document->getMimeType(); } if (!is_null($document->getContent())) { $valueArray['content'] = $document->getContent(); } if (!is_null($document->getGeneralPriority())) { $valueArray['generalPriority'] = $document->getGeneralPriority(); } if (!is_null($document->getTemporaryPriority())) { $valueArray['temporaryPriority'] = $document->getTemporaryPriority(); } if (!is_null($document->getPageRank())) { $valueArray['pageRank'] = $document->getPageRank(); } if (!is_null($document->getSolrCoreHints())) { $valueArray['solrCoreHints'] = $document->getSolrCoreHints(); } return $valueArray; }