class SFCreationResult
Class SFCreationResult
protected Result
|
$_res |
public
|
|
__construct(Result $res)
|
SFCreation constructor. | |
public static
|
SFCreationResult |
ok(SFCreation $value)
|
No description | |
public static
|
SFCreationResult |
err(Exception $err)
|
No description | |
public
|
bool |
isOk()
|
No description | |
public
|
bool |
isError()
|
No description | |
public
|
SFCreation |
value()
|
No description | |
public
|
Exception |
getErr()
|
No description | |
public
|
mixed |
valueOr($fallback)
|
No description |
ok()
public static SFCreationResult ok(SFCreation $value)
err()
public static SFCreationResult err(Exception $err)
isOk()
public bool isOk()
bool |
Result::isOk() |
isError()
public bool isError()
bool |
Result::isError() |
value()
public SFCreation value()
valueOr()
public mixed valueOr($fallback)
$fallback |
mixed |
Result::valueOr() |
<?php
namespace SFClient\Result;
use SFClient\Result\Result;
use SFClient\SalesForce\SFCreation;
/**
* Class SFCreationResult
* @package SFClient\Result
*/
class SFCreationResult {
/**
* @var Result
*/
protected $_res;
/**
* SFCreation constructor.
* @param Result $res
*/
public function __construct(Result $res) {
$this->res = $res;
}
/**
* @param SFCreation $value
* @return SFCreationResult
* @see Result::ok()
*/
public static function ok(SFCreation $value): SFCreationResult {
return new SFCreationResult(Result::ok($value));
}
/**
* @param \Exception $err
* @return SFCreationResult
* @see Result::err()
*/
public static function err(\Exception $err): SFCreationResult {
return new SFCreationResult(Result::err($err));
}
/**
* @return bool
* @see Result::isOk()
*/
public function isOk(): bool {
return $this->res->isOk();
}
/**
* @return bool
* @see Result::isError()
*/
public function isError(): bool {
return $this->res->isError();
}
/**
* @return SFCreation
* @throws \Exception
* @see Result::value()
*/
public function value(): SFCreation {
return $this->res->value();
}
/**
* @return \Exception
* @see Result::getErr()
*/
public function getErr(): \Exception {
return $this->res->getErr();
}
/**
* @param $fallback
* @return mixed
* @see Result::valueOr()
*/
public function valueOr($fallback) {
return $this->res->valueOr($fallback);
}
}