public function setStatus($status)
{
if (is_bool($status)) {
$status = $status ? self::STATUS_OK : self::STATUS_ERROR;
}
if (!in_array($status, array(self::STATUS_OK, self::STATUS_ERROR, self::STATUS_WARNING))) {
throw new LogicException('Wrong status was given. Use constants: Result::OK, Result::ERROR, Result::WARNING');
}
$this->_status = $status;
return $this;
}