mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Update status attribute
This commit is contained in:
@@ -17,7 +17,7 @@ class Status implements AttributeInterface
|
||||
{
|
||||
protected $status;
|
||||
|
||||
public function __construct($status)
|
||||
public function __construct(Application $app, $status)
|
||||
{
|
||||
/**
|
||||
* We store a binary string
|
||||
@@ -29,11 +29,11 @@ class Status implements AttributeInterface
|
||||
} elseif (ctype_digit($status)) {
|
||||
$status = decbin((int) $status);
|
||||
} elseif (strpos($status, '0x') === 0 && ctype_xdigit(substr($status, 2))) {
|
||||
$status = \databox_status::hex2bin($status);
|
||||
$status = \databox_status::hex2bin($app, $status);
|
||||
} elseif (strpos($status, '0b') === 0 && preg_match('/^[01]+$/', substr($status, 2))) {
|
||||
$status = substr($status, 2);
|
||||
} elseif (ctype_xdigit($status)) {
|
||||
$status = \databox_status::hex2bin($status);
|
||||
$status = \databox_status::hex2bin($app, $status);
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Invalid status argument');
|
||||
}
|
||||
@@ -58,6 +58,6 @@ class Status implements AttributeInterface
|
||||
|
||||
public static function loadFromString(Application $app, $string)
|
||||
{
|
||||
return new static($string);
|
||||
return new static($app, $string);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user