getImageIdentifier() public method

Get the image identifier
public getImageIdentifier ( ) : string
return string
Example #1
0
File: JSON.php Project: ASP96/imbo
 /**
  * {@inheritdoc}
  */
 public function formatError(Model\Error $model)
 {
     $data = array('error' => array('code' => $model->getHttpCode(), 'message' => $model->getErrorMessage(), 'date' => $this->dateFormatter->formatDate($model->getDate()), 'imboErrorCode' => $model->getImboErrorCode()));
     if ($imageIdentifier = $model->getImageIdentifier()) {
         $data['imageIdentifier'] = $imageIdentifier;
     }
     return $this->encode($data);
 }
Example #2
0
File: XML.php Project: ASP96/imbo
    /**
     * {@inheritdoc}
     */
    public function formatError(Model\Error $model)
    {
        $imageIdentifierXml = '';
        if ($imageIdentifier = $model->getImageIdentifier()) {
            $imageIdentifierXml = '<imageIdentifier>' . $imageIdentifier . '</imageIdentifier>';
        }
        return <<<ERROR
<?xml version="1.0" encoding="UTF-8"?>
<imbo>
  <error>
    <code>{$model->getHttpCode()}</code>
    <message>{$model->getErrorMessage()}</message>
    <date>{$this->dateFormatter->formatDate($model->getDate())}</date>
    <imboErrorCode>{$model->getImboErrorCode()}</imboErrorCode>
  </error>
  {$imageIdentifierXml}
</imbo>
ERROR;
    }
Example #3
0
 /**
  * @covers Imbo\Model\Error::getImageIdentifier
  * @covers Imbo\Model\Error::setImageIdentifier
  */
 public function testCanSetAndGetImageIdentifier()
 {
     $this->assertNull($this->model->getImageIdentifier());
     $this->assertSame($this->model, $this->model->setImageIdentifier('identifier'));
     $this->assertSame('identifier', $this->model->getImageIdentifier());
 }