read() return null insted of false
This commit is contained in:
@@ -20,7 +20,7 @@ use InvalidArgumentException as exception_invalid_argument;
|
|||||||
* @package mirzaev\record\interfaces
|
* @package mirzaev\record\interfaces
|
||||||
*
|
*
|
||||||
* @method void __construct(record|null $record) Constructor
|
* @method void __construct(record|null $record) Constructor
|
||||||
* @method static|false read(callable $filter) Read from the database
|
* @method static|null read(callable $filter) Read from the database
|
||||||
* @method static|false update() Update the record in the database
|
* @method static|false update() Update the record in the database
|
||||||
*
|
*
|
||||||
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
* @license http://www.wtfpl.net/ Do What The Fuck You Want To Public License
|
||||||
@@ -44,9 +44,9 @@ interface record
|
|||||||
*
|
*
|
||||||
* Search for the record in the database
|
* Search for the record in the database
|
||||||
*
|
*
|
||||||
* @return static|false The record impementator object, if found
|
* @return static|null The record implementator object
|
||||||
*/
|
*/
|
||||||
public function read(callable $filter): static|false;
|
public function read(callable $filter): ?static;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update
|
* Update
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use Exception as exception,
|
|||||||
* @package mirzaev\record\traits
|
* @package mirzaev\record\traits
|
||||||
*
|
*
|
||||||
* @method self __construct(?record $record) Constructor
|
* @method self __construct(?record $record) Constructor
|
||||||
* @method static|false read(callable $filter) Read from the database
|
* @method static|null read(callable $filter) Read from the database
|
||||||
* @method static|false update() Update the record in the database
|
* @method static|false update() Update the record in the database
|
||||||
* @method void __set(string $name, mixed $value = null) Write into the database record property
|
* @method void __set(string $name, mixed $value = null) Write into the database record property
|
||||||
* @method mixed __get(string $name) Read from the database record property
|
* @method mixed __get(string $name) Read from the database record property
|
||||||
@@ -76,9 +76,9 @@ trait record
|
|||||||
*
|
*
|
||||||
* Search for the record in the database
|
* Search for the record in the database
|
||||||
*
|
*
|
||||||
* @return static|false The record impementator object, if found
|
* @return static|null The record implementator object
|
||||||
*/
|
*/
|
||||||
public function read(callable $filter): static|false
|
public function read(callable $filter): ?static
|
||||||
{
|
{
|
||||||
// Reading from the database
|
// Reading from the database
|
||||||
$record = $this->database->read(
|
$record = $this->database->read(
|
||||||
@@ -95,7 +95,7 @@ trait record
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Exit (fail)
|
// Exit (fail)
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user