Beispiel #1
0
 /**
  * @param null   $variables
  * @param mixed|int    $code - 0 for success
  * @param string $message - General public message for client
  * @param array  $errors - Example - Pass the messages from input validator
  * @param null   $options
  */
 public function __construct($variables = null, $code = 0, $message = 'OK', $errors = [], $options = null)
 {
     $this->setCode($code);
     $this->setMessage($message);
     $this->setErrors($errors);
     parent::__construct($variables, $options);
 }
Beispiel #2
0
 /**
  * Initialize instance
  * 
  * @param InputFilterInterface $inputFilter
  * @param string $variables
  * @param string $options
  */
 public function __construct(InputFilterInterface $inputFilter, $variables = null, $options = null)
 {
     parent::__construct($variables, $options);
     $this->setVariable('isValid', $inputFilter->isValid());
     $messages = $inputFilter->getMessages();
     $inputs = array();
     foreach ($inputFilter->getValues() as $name => $value) {
         $inputs[$name] = array('value' => $value, 'messages' => array_key_exists($name, $messages) ? $messages[$name] : array());
     }
     $this->setVariable('inputs', $inputs);
 }
Beispiel #3
0
 /**
  * Create a new model.
  *
  * The API response object can be passed here directly as the first
  * argument.
  *
  * @param \Omeka\Api\Response $apiResponse API response object
  * @param array|Traversable $options
  */
 public function __construct($apiResponse = null, $options = null)
 {
     $variables = [self::API_RESPONSE_KEY => $apiResponse];
     parent::__construct($variables, $options);
 }
Beispiel #4
0
 public function __construct($variables = null, $options = null)
 {
     parent::__construct($variables, $options);
     $this->success = true;
 }
 /**
  * @param object|null $model The model to serialize.
  * @param array|\Traversable|null $options
  */
 public function __construct($model = null, $options = null)
 {
     parent::__construct(array('model' => $model), $options);
 }
Beispiel #6
0
 /**
  * @param int $errCode
  * @param array|null|\Traversable $errMessage
  * @param null $options
  */
 public function __construct($errCode, $errMessage, $options = null)
 {
     $this->errCode = $errCode;
     $this->errMessage = $errMessage;
     parent::__construct(null, $options);
 }
Beispiel #7
0
 /**
  * @param mixed $variables
  * @param string $options
  */
 public function __construct($variables = null, $options = null)
 {
     parent::__construct($variables, $options);
 }