Major upgrade #3

Merged
Llewellyn merged 11 commits from dev into master 2023-08-01 07:42:01 +00:00
3 changed files with 34 additions and 10 deletions
Showing only changes of commit 5b315f2cf0 - Show all commits

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))
{