Imbo\Http\Request\Request::getImage PHP Method

getImage() public method

Get an image model attached to the request (on POST)
public getImage ( ) : null | Image
return null | Imbo\Model\Image
    public function getImage()
    {
        return $this->image;
    }

Usage Example

Example #1
0
 /**
  * Create an error based on an exception instance
  *
  * @param Exception $exception An Imbo\Exception instance
  * @param Request The current request
  * @return Error
  */
 public static function createFromException(Exception $exception, Request $request)
 {
     $date = new DateTime('now', new DateTimeZone('UTC'));
     $model = new self();
     $model->setHttpCode($exception->getCode())->setErrorMessage($exception->getMessage())->setDate($date)->setImboErrorCode($exception->getImboErrorCode() ?: Exception::ERR_UNSPECIFIED);
     if ($image = $request->getImage()) {
         $model->setImageIdentifier($image->getChecksum());
     } else {
         if ($identifier = $request->getImageIdentifier()) {
             $model->setImageIdentifier($identifier);
         }
     }
     return $model;
 }
All Usage Examples Of Imbo\Http\Request\Request::getImage