/**
  * Returns the moderation status of an image
  * @param string|array $params
  *  (string) ID of an image being moderated returned originally by imgCheck
  *  (array) multiple parameters
  * @return boolean|null null => pending, true => approved, false => declined
  * @link http://www.webpurify.com/image-moderation/documentation/methods/webpurify.live.imgstatus.php
  */
 public function imgStatus($params = array())
 {
     if (is_string($params)) {
         $params = array('imgid' => $params);
     }
     WebPurify::requireExactlyOneParamFrom($params, array('imgid', 'customimgid'));
     $response = $this->request('imgstatus', $params);
     $status = null;
     if (is_string($response->status)) {
         $status = $response->status;
     }
     switch ($status) {
         case 'pending':
             return null;
         case 'approved':
             return true;
         case 'declined':
             return false;
         default:
             throw new WebPurifyException('Unknown image status response: ' . $status);
     }
 }
Esempio n. 2
0
 /**
  * @param string $apiKey The API key from WebPurify to verify content
  */
 public function __construct($apiKey)
 {
     parent::__construct($apiKey);
     // Use the US endpoint
     $this->setEndPointDomain(static::END_POINT_DOMAIN_UNITED_STATES);
 }