update 2023-06-21 03:10:00

This commit is contained in:
Robot 2023-06-21 03:10:03 +02:00
parent 9340afb222
commit 5b315f2cf0
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
3 changed files with 34 additions and 10 deletions

View File

@ -15,9 +15,9 @@ abstract Model #Orange {
# Table $table
+ __construct(Table $table)
+ {abstract} value(mixed $value, string $field, ...) : mixed
+ item(object $item, ?string $table = null) : ?object
+ item(?object $item, ?string $table = null) : ?object
+ items(?array $items = null, ?string $table = null) : ?array
+ row(array $item, ?string $table = null) : ?array
+ row(?array $item, ?string $table = null) : ?array
+ rows(?array $items = null, ?string $table = null) : ?array
+ last(?string $table = null) : ?int
# getTableFields(string $table, bool $default = false) : ?array

View File

@ -69,14 +69,20 @@ abstract class Model
* Model the values of an item
* Example: $this->item(Object, 'table_name');
*
* @param object $item The item object
* @param object|null $item The item object
* @param string|null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): ?object
public function item(?object $item, ?string $table = null): ?object
{
// we must have an object
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{
@ -172,14 +178,20 @@ abstract class Model
* Model the values of an row
* Example: $this->item(Array, 'table_name');
*
* @param array $item The item array
* @param array|null $item The item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function row(array $item, ?string $table = null): ?array
public function row(?array $item, ?string $table = null): ?array
{
// we must have an array
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{

View File

@ -43,14 +43,20 @@
* Model the values of an item
* Example: $this->item(Object, 'table_name');
*
* @param object $item The item object
* @param object|null $item The item object
* @param string|null $table The table
*
* @return object|null
* @since 3.2.0
*/
public function item(object $item, ?string $table = null): ?object
public function item(?object $item, ?string $table = null): ?object
{
// we must have an object
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{
@ -146,14 +152,20 @@
* Model the values of an row
* Example: $this->item(Array, 'table_name');
*
* @param array $item The item array
* @param array|null $item The item array
* @param string|null $table The table
*
* @return array|null
* @since 3.2.0
*/
public function row(array $item, ?string $table = null): ?array
public function row(?array $item, ?string $table = null): ?array
{
// we must have an array
if (empty($item))
{
return null;
}
// set the table name
if (empty($table))
{