getImboErrorCode() публичный Метод

Get the imbo error code
public getImboErrorCode ( ) : integer
Результат integer
Пример #1
0
 /**
  * Set an error model and update some parts of the response object
  *
  * @param Model\Error $error An error model instance
  * @return Response
  */
 public function setError(Model\Error $error)
 {
     $errorMessage = $error->getErrorMessage();
     $this->headers->add(array('X-Imbo-Error-Message' => $errorMessage, 'X-Imbo-Error-InternalCode' => $error->getImboErrorCode(), 'X-Imbo-Error-Date' => $error->getDate()->format('D, d M Y H:i:s') . ' GMT'));
     $this->setStatusCode($error->getHttpCode(), $errorMessage)->setEtag(null)->setLastModified(null);
     $this->setModel($error);
     return $this;
 }
Пример #2
0
 /**
  * {@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);
 }
Пример #3
0
Файл: XML.php Проект: 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;
    }
Пример #4
0
 /**
  * @covers Imbo\Model\Error::getImboErrorCode
  * @covers Imbo\Model\Error::setImboErrorCode
  */
 public function testCanSetAndGetImboErrorCode()
 {
     $this->assertNull($this->model->getImboErrorCode());
     $this->assertSame($this->model, $this->model->setImboErrorCode(100));
     $this->assertSame(100, $this->model->getImboErrorCode());
 }