-
Notifications
You must be signed in to change notification settings - Fork 74
Photo
- Class name: Photo
- Namespace: Crew\Unsplash
- Parent class: Crew\Unsplash\Endpoint
private mixed $photographer
- Visibility: private
private array $parameters
All parameters that an endpoint can have.
- Visibility: private
private array $acceptedHttpMethod = array('get', 'post', 'put')
List of accepted http actions that the application can execute.
- Visibility: private
- This property is static.
\Crew\Unsplash\Photo Crew\Unsplash\Photo::find(string $id)
Retrieve the photo object from the id specified.
- Visibility: public
- This method is static.
- $id string - <p>Id of the photo to find</p>
\Crew\Unsplash\ArrayObject Crew\Unsplash\Photo::all(integer $page, integer $per_page)
Retrieve all the photos on a specific page.
The function retrieve an ArrayObject that contains Photo object.
- Visibility: public
- This method is static.
- $page integer - <p>Page from which the photos need to be retrieve</p>
- $per_page integer - <p>Number of element in a page</p>
\Crew\Unsplash\ArrayObject Crew\Unsplash\Photo::search(string $search, integer $category, integer $page, integer $per_page)
Retrieve all the photos on a specific page depending on search results. The function retrieve an ArrayObject that contains Photo object.
- Visibility: public
- This method is static.
- $search string - <p>Retrieve photos matching the search word</p>
- $category integer - <p>Retrieve photos matching the category id</p>
- $page integer - <p>Page from which the photos need to be retrieve</p>
- $per_page integer - <p>Number of element in a page</p>
\Crew\Unsplash\Photo Crew\Unsplash\Photo::create(string $filePath)
Create a new photo. The user needs to connect to their account and grant permission to write_photo.
- Visibility: public
- This method is static.
- $filePath string - <p>Path of the file need to upload</p>
\Crew\Unsplash\User Crew\Unsplash\Photo::photographer()
Retrieve the user object of the photographer who took the photo.
- Visibility: public
mixed Crew\Unsplash\Endpoint::__construct($parameters)
Construct a new endpoint object and set the parameters from an array.
- Visibility: public
- This method is defined by Crew\Unsplash\Endpoint
- $parameters mixed
void Crew\Unsplash\Endpoint::update(array $parameters)
Merge the old parameters with the new one.
- Visibility: public
- This method is defined by Crew\Unsplash\Endpoint
- $parameters array
mixed Crew\Unsplash\Endpoint::__get(string $key)
Magic method to retrieve a specific parameter in the parameters array.
- Visibility: public
- This method is defined by Crew\Unsplash\Endpoint
- $key string
string Crew\Unsplash\Endpoint::__callStatic(string $method, array $arguments)
Validate if the http method is accepted and send an http request to it.
Retrieve error from the request and throw a new error.
- Visibility: public
- This method is static.
- This method is defined by Crew\Unsplash\Endpoint
- $method string - <p>Http action to trigger</p>
- $arguments array - <p>Array containing all the parameters pass to the magic method</p>
mixed Crew\Unsplash\Endpoint::getArray($responseBody, $object)
- Visibility: protected
- This method is static.
- This method is defined by Crew\Unsplash\Endpoint
- $responseBody mixed
- $object mixed
boolean Crew\Unsplash\Endpoint::isGoodRequest(\Crew\Unsplash\GuzzleHttp\Psr7\Response $response)
Retrieve the response status code and determine if the request was a success or not.
- Visibility: private
- This method is static.
- This method is defined by Crew\Unsplash\Endpoint
- $response Crew\Unsplash\GuzzleHttp\Psr7\Response - <p>of the http request</p>
string Crew\Unsplash\Endpoint::getErrorMessage(\Crew\Unsplash\GuzzleHttp\Psr7\Response $response)
Retrieve the error message in the body
- Visibility: private
- This method is static.
- This method is defined by Crew\Unsplash\Endpoint
- $response Crew\Unsplash\GuzzleHttp\Psr7\Response - <p>of the http request</p>