forked from joomla/super-powers
Update 2024-07-11 23:11:32
This commit is contained in:
parent
0160c64a63
commit
5d28565ce7
@ -13,7 +13,7 @@
|
||||
@startuml
|
||||
interface MultiSubformInterface #Lavender {
|
||||
+ get(array $getMap) : ?array
|
||||
+ set(array $items, array $setMap) : bool
|
||||
+ set(mixed $items, array $setMap) : bool
|
||||
}
|
||||
|
||||
note right of MultiSubformInterface::get
|
||||
|
@ -49,7 +49,7 @@ interface MultiSubformInterface
|
||||
/**
|
||||
* Set a subform items
|
||||
*
|
||||
* @param array $items The list of items from the subform to set
|
||||
* @param mixed $items The list of items from the subform to set
|
||||
* @param array $setMap The the map to set the subfrom data
|
||||
*
|
||||
* Example:
|
||||
@ -72,6 +72,6 @@ interface MultiSubformInterface
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
public function set(array $items, array $setMap): bool;
|
||||
public function set(mixed $items, array $setMap): bool;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
/**
|
||||
* Set a subform items
|
||||
*
|
||||
* @param array $items The list of items from the subform to set
|
||||
* @param mixed $items The list of items from the subform to set
|
||||
* @param array $setMap The the map to set the subfrom data
|
||||
*
|
||||
* Example:
|
||||
@ -51,4 +51,4 @@
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
public function set(array $items, array $setMap): bool;
|
||||
public function set(mixed $items, array $setMap): bool;
|
@ -15,7 +15,7 @@ class MultiSubform << (F,LightGreen) >> #RoyalBlue {
|
||||
# Subform $subform
|
||||
+ __construct(Subform $subform)
|
||||
+ get(array $getMap) : ?array
|
||||
+ set(array $items, array $setMap) : bool
|
||||
+ set(mixed $items, array $setMap) : bool
|
||||
- getSubformData(array $map, ?array $coreData = null) : ?array
|
||||
- setSubformData(array $items, array $map, ...) : bool
|
||||
- setLinkValue(string $linkValue, ?array $data = null) : ?string
|
||||
|
@ -94,7 +94,7 @@ final class MultiSubform implements MultiSubformInterface
|
||||
/**
|
||||
* Set a subform items
|
||||
*
|
||||
* @param array $items The list of items from the subform to set
|
||||
* @param mixed $items The list of items from the subform to set
|
||||
* @param array $setMap The the map to set the subfrom data
|
||||
*
|
||||
* Example:
|
||||
@ -117,7 +117,7 @@ final class MultiSubform implements MultiSubformInterface
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
public function set(array $items, array $setMap): bool
|
||||
public function set(mixed $items, array $setMap): bool
|
||||
{
|
||||
// Validate the core map presence and structure
|
||||
if (!isset($setMap['_core']) || !is_array($setMap['_core']) || !$this->validSetMap($setMap['_core']))
|
||||
@ -125,6 +125,12 @@ final class MultiSubform implements MultiSubformInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
// catch an empty set
|
||||
if (!is_array($items))
|
||||
{
|
||||
$items = []; // will delete all exisitng linked items :( not ideal, but real
|
||||
}
|
||||
|
||||
// Save the core data
|
||||
if (!$this->setSubformData($items, $setMap['_core']))
|
||||
{
|
||||
|
@ -69,7 +69,7 @@
|
||||
/**
|
||||
* Set a subform items
|
||||
*
|
||||
* @param array $items The list of items from the subform to set
|
||||
* @param mixed $items The list of items from the subform to set
|
||||
* @param array $setMap The the map to set the subfrom data
|
||||
*
|
||||
* Example:
|
||||
@ -92,7 +92,7 @@
|
||||
* @return bool
|
||||
* @since 3.2.2
|
||||
*/
|
||||
public function set(array $items, array $setMap): bool
|
||||
public function set(mixed $items, array $setMap): bool
|
||||
{
|
||||
// Validate the core map presence and structure
|
||||
if (!isset($setMap['_core']) || !is_array($setMap['_core']) || !$this->validSetMap($setMap['_core']))
|
||||
@ -100,6 +100,12 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
// catch an empty set
|
||||
if (!is_array($items))
|
||||
{
|
||||
$items = []; // will delete all exisitng linked items :( not ideal, but real
|
||||
}
|
||||
|
||||
// Save the core data
|
||||
if (!$this->setSubformData($items, $setMap['_core']))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user