Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6937c70c9c | |||
d0a661016b | |||
dd6fc42732 |
@@ -66,4 +66,4 @@ if ($database->write($record)) {
|
|||||||
## Used by
|
## Used by
|
||||||
- My site-article about how i was kidnapped by PMC Wagner operatives [mirzaev/repression](https://git.svoboda.works/mirzaev/repression)
|
- My site-article about how i was kidnapped by PMC Wagner operatives [mirzaev/repression](https://git.svoboda.works/mirzaev/repression)
|
||||||
- My decentralized P2P blockchain chats project [mirzaev/notchat](https://git.svoboda.works/mirzaev/notchat)
|
- My decentralized P2P blockchain chats project [mirzaev/notchat](https://git.svoboda.works/mirzaev/notchat)
|
||||||
- Svoboda Telegram chat-robot [svoboda/negotiator](https://git.svoboda.works/svoboda/negotiator)
|
- Svoboda Telegram chat-robot negotiator [svoboda/negotiator](https://git.svoboda.works/svoboda/negotiator)
|
||||||
|
@@ -463,9 +463,11 @@ class database
|
|||||||
} else {
|
} else {
|
||||||
// The record contains only empty values
|
// The record contains only empty values
|
||||||
}
|
}
|
||||||
} catch (exception_logic | exception_invalid_argument $exception) {
|
} catch (exception_logic | exception_invalid_argument | exception_domain $exception) {
|
||||||
// Writing into the buffer of failed to reading records
|
// Writing into the buffer of failed to reading records
|
||||||
/* $failed[] = $record; */
|
|
||||||
|
// Exit (fail)
|
||||||
|
throw new exception_runtime('Failed to processing the record', previous: $exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4,6 +4,9 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace mirzaev\baza;
|
namespace mirzaev\baza;
|
||||||
|
|
||||||
|
// Built-in libraries
|
||||||
|
use DomainException as exception_domain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Record
|
* Record
|
||||||
*
|
*
|
||||||
@@ -63,12 +66,23 @@ class record
|
|||||||
* @param string $name Name of the parameter
|
* @param string $name Name of the parameter
|
||||||
* @param mixed $value Content of the parameter
|
* @param mixed $value Content of the parameter
|
||||||
*
|
*
|
||||||
|
* @throws exception_domain if not found the parameter
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __set(string $name, mixed $value = null): void
|
public function __set(string $name, mixed $value = null): void
|
||||||
{
|
{
|
||||||
|
if (isset($this->values[$name])) {
|
||||||
|
// Initialized the parameter
|
||||||
|
|
||||||
// Writing the value and exit
|
// Writing the value and exit
|
||||||
$this->values[$name] = $value;
|
$this->values[$name] = $value;
|
||||||
|
} else {
|
||||||
|
// Not initialized the parameter
|
||||||
|
|
||||||
|
// Exit (fail)
|
||||||
|
throw new exception_domain("Not found the parameter: $name");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user