Class shardimage\shardimagephp\services\UploadService

Inheritanceshardimage\shardimagephp\services\UploadService » shardimage\shardimagephp\services\Service » shardimage\shardimagephpapi\base\BaseObject

Shardimage upload service.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$client shardimage\shardimagephp\auth\Client Shardimage API Client shardimage\shardimagephp\services\Service
$lastError mixed Last error in the service shardimage\shardimagephp\services\Service
$version string Shardimage module version shardimage\shardimagephp\services\Service

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Creates the service. shardimage\shardimagephp\services\Service
__get() Returns the value of a non-defined property, it there is a getter method. shardimage\shardimagephpapi\base\BaseObject
__isset() Does the non-defined property with a getter exist and is it not NULL? shardimage\shardimagephpapi\base\BaseObject
__set() Sets the value of a non-defined property, if there is a setter method. shardimage\shardimagephpapi\base\BaseObject
__unset() Sets the value of a non-defined property to NULL, if there is a setter. shardimage\shardimagephpapi\base\BaseObject
copy() Makes a copy of an image. shardimage\shardimagephp\services\UploadService
getController() shardimage\shardimagephp\services\UploadService
getLastError() Returns the last error in the service. shardimage\shardimagephp\services\Service
getModule() shardimage\shardimagephp\services\UploadService
modify() Modifies an image by changing storage format and/or transformations. shardimage\shardimagephp\services\UploadService
toArray() Converts the object an array. shardimage\shardimagephpapi\base\BaseObject
upload() Uploads an image from a local source. shardimage\shardimagephp\services\UploadService
uploadRemote() Uploads an image from a remote source. shardimage\shardimagephp\services\UploadService

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
ensureClass() Creates an object from the given parameters. shardimage\shardimagephpapi\base\BaseObject
init() Custom initialization. shardimage\shardimagephpapi\base\BaseObject
sendRequest() Sends the request to the Shardimage API and returns with the Response object or the ID for the request if deferred. shardimage\shardimagephp\services\Service

Method Details

copy() public method

Makes a copy of an image.

public shardimage\shardimagephp\models\image\Image|shardimage\shardimagephpapi\api\Response copy ( $params, $optParams = [] )
$params array

Required API parameters

  • cloudId - cloud ID
  • publicId - image ID
  • newCloudId - new cloud ID, if differs
  • $optParams array

    Optional API parameters

    getController() public static method

    public static void getController ( )
    getModule() public static method

    public static void getModule ( )
    modify() public method

    Modifies an image by changing storage format and/or transformations.

    public shardimage\shardimagephp\models\image\Image|shardimage\shardimagephpapi\api\Response modify ( $params, $optParams = [] )
    $params array|string

    Required API parameters

  • publicId - image ID
  • cloudId - cloud ID
  • $optParams array

    Optional API parameters

  • format - image format
  • transformation - transformations
  • tags - tags
  • plugins - plugins
  • upload() public method

    Uploads an image from a local source.

    public shardimage\shardimagephp\models\image\Image|shardimage\shardimagephpapi\api\Response upload ( $params, $optParams = [] )
    $params array|string|resource

    Required API parameters

  • file - source (string - filepath, array - a $_FILES entry, resource - an opened file resource (@see fopen()), an array with a 'file' key consisting of the above 3)
  • cloudId - cloud ID
  • $optParams array

    Optional API parameters

  • publicId - image ID
  • format - image format
  • transformation - transformations
  • tags - tags
  • plugins - plugins
  • uploadRemote() public method

    Uploads an image from a remote source.

    public shardimage\shardimagephp\models\image\Image|shardimage\shardimagephpapi\api\Response uploadRemote ( $params, $optParams = [] )
    $params array|string

    Required API parameters

  • resource - source (string - URL, an array with a 'remote' key consisting of the above)
  • $optParams array

    Optional API parameters

  • publicId - image ID
  • format - image format
  • transformation - transformations
  • tags - tags
  • plugins - plugins