Skip to content
Snippets Groups Projects
Commit 0164f11d authored by Omar Mohamad - El Hassan Lopesino's avatar Omar Mohamad - El Hassan Lopesino
Browse files

Revert "Issue #3285444: Service to search images"

This reverts commit 7292f388.
parent 7292f388
No related branches found
No related tags found
No related merge requests found
Pipeline #413251 canceled
......@@ -8,9 +8,6 @@ services:
smugmug_api.image:
class: Drupal\smugmug_api\Service\Image
arguments: ["@smugmug_api.client", "@logger.factory"]
smugmug_api.image_search:
class: Drupal\smugmug_api\Service\ImageSearch
arguments: ["@smugmug_api.client", "@logger.factory"]
smugmug_api.node:
class: Drupal\smugmug_api\Service\Node
arguments: ["@smugmug_api.client", "@logger.factory"]
......
<?php
namespace Drupal\smugmug_api\Service;
use Drupal\Core\Logger\LoggerChannelFactory;
/**
* Class ImageSearch.
*
* @package Drupal\smugmug_api\Service
*/
class ImageSearch {
/**
* Client.
*
* @var \Drupal\smugmug_api\Service\Client
*/
protected $client;
/**
* Logger Factory.
*
* @var \Drupal\Core\Logger\LoggerChannelFactory
*/
protected $loggerFactory;
/**
* Media constructor.
*
* @param \Drupal\smugmug_api\Service\Client $client
* Client.
* @param \Drupal\Core\Logger\LoggerChannelFactory $loggerFactory
* LoggerChannelFactory.
*/
public function __construct(Client $client,
LoggerChannelFactory $loggerFactory) {
// SmugMug API Client.
$this->client = $client;
$this->loggerFactory = $loggerFactory;
}
/**
* An image is a photo or video stored on SmugMug.
*
* @param array $arguments
* The search arguments.
* @param bool $cacheable
* Cacheable.
*
* @return array|bool
* Response array.
* https://api.smugmug.com/api/v2/image!search#response
*
* @see https://api.smugmug.com/api/v2/image!search
*/
public function searchImages($arguments = [], $cacheable = TRUE) {
$arguments['Type'] = 'Image';
$response = $this->client->request(
'image!search',
$arguments,
$cacheable
);
if ($response) {
return $response['Image'];
}
return FALSE;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment