Maps the (aggregate root) node data and registers the objects as
reconstituted with the session.

Note: QueryResult relies on the fact that the first object of $objects has the numeric index "0"

@param array $objectsData
@return array
18125
public function mapToObjects(array $objectsData)
    {
        $objects = [];
        foreach ($objectsData as $objectData) {
            $objects[] = $this->mapToObject($objectData);
        }

        return $objects;
    }
1338844
private function prepareValues($arrayData)
    {
        $arrayData = array_values($arrayData);

        $preparedValues = [];
        $vNumber = 1;
        foreach ($arrayData as $value) {
            $preparedValues[":value{$vNumber}"] = "$value";
            $vNumber++;
        }

        unset($arrayData);
        unset($vNumber);

        return $preparedValues;
    }
32618
private function mapDataToFactObjects(array $data)
    {
        return array_map(function($factData) {
            return (new Fact)
                ->setText($factData['text'])
                ->setGroups($factData['groups'])
            ;
        }, $data);
    }
753520
public static function filterListData($objectData, $filters = array())
    {
        $result = array();
        foreach ($objectData as $fieldData) {
            $filteredItems = array();
            //====================================================================//
            // Ensure Item is An Array of Fields
            if (!is_array($fieldData) && !($fieldData instanceof ArrayObject)) {
                continue;
            }
            //====================================================================//
            // Convert ArrayObjects to Array
            if ($fieldData instanceof ArrayObject) {
                $fieldData = $fieldData->getArrayCopy();
            }
            //====================================================================//
            // Search for Field in Item Block
            foreach ($filters as $fieldId) {
                if (array_key_exists($fieldId, $fieldData)) {
                    $filteredItems[$fieldId] = $fieldData[$fieldId];
                }
            }
            $result[] = $filteredItems;
        }

        return $result;
    }
173495
protected function arrayToDto(array $itemData)
    {
        foreach ($itemData as $field => $value) {
            if (!isset($this->scheme[$field])) {
                throw new InvalidArgumentException("Undefined field '$field' in scheme");
            }

            $typeService = $this->scheme[$field]['type'];
            $itemData[$field] = $this->typePluginManager->get($typeService, ['value' => $value]);
        }

        return new $this->dtoClassName($itemData);
    }
170195
public function sumDuplicateQueries($modelData)
    {
        $numDuplicates = 0;
        $duplicates = ArrayHelper::getColumn($modelData, 'duplicate');
        foreach ($duplicates as $duplicate) {
            if ($duplicate > 1) {
                $numDuplicates++;
            }
        }

        return $numDuplicates;
    }
447608
public function persistAllObjects(PersistenceContext $context, array $objects) : array
    {
        $rows = [];

        foreach ($objects as $key => $object) {
            $rows[$key] = new Row($this->table);
        }

        $this->persistAllBeforeParent($context, $objects, $rows);
        $this->persistAll($context, $objects, $rows);
        $this->persistAllAfterParent($context, $objects, $rows);

        return $rows;
    }
411743
public function setNodeData(NodeData $nodeData): void
    {
        $this->nodeData = $nodeData;
        $this->nodeDataIsMatchingContext = null;
    }
724778
public function createObjectStateListFromData(array $data)
    {
        $objectStates = array();

        foreach ($data as $objectStateData) {
            $objectStates[] = $this->createObjectStateFromData($objectStateData);
        }

        return $objectStates;
    }
1325137
public static function objectToArray($data)
    {
        if (is_object($data)) {
            // Gets the properties of the given object
            // with get_object_vars function
            $data = get_object_vars($data);
        }

        if (is_array($data)) {
            /*
            * Return array converted to object
            * Using __FUNCTION__ (Magic constant)
            * for recursive call
            */
            $self_name = 'self::' . __FUNCTION__;

            return array_map($self_name, $data);
        } else {
            // Return array
            return $data;
        }
    }
616200
public static function load($fieldData, $objectClass = null)
    {
        //====================================================================//
        // Decode Object Type & Id
        $objectType = self::objectType($fieldData);
        $objectId = self::objectId($fieldData);
        if (!$objectType || !$objectId) {
            return null;
        }
        //====================================================================//
        // Load Splash Object
        $splashObject = Splash::object($objectType);
        if (empty($splashObject)) {
            return null;
        }
        //====================================================================//
        // Ensure Splash Object uses InteliParserTrait
        if (!in_array(IntelParserTrait::class, class_uses($splashObject), true)) {
            return null;
        }
        if (!method_exists($splashObject, 'load')) {
            return null;
        }
        //====================================================================//
        // Load Remote Object
        $remoteObject = $splashObject->load($objectId);
        if (!$remoteObject) {
            return null;
        }
        //====================================================================//
        // Verify Remote Object
        if (!empty($objectClass) && !($remoteObject instanceof $objectClass)) {
            return null;
        }
        //====================================================================//
        // Return Remote Object
        return   $remoteObject;
    }
893218
public function convertObjectInFolderList(array $data = null)
    {
        if (empty($data)) {
            return null;
        }
        $objects = array_filter(
            array_map(
                [$this, 'convertObjectInFolder'],
                $data[JSONConstants::JSON_OBJECTINFOLDERLIST_OBJECTS] ?? []
            ),
            function ($item) { return !empty($item); }
        );
        $objectInFolderList = new ObjectInFolderList();
        $objectInFolderList->setObjects($objects);
        $objectInFolderList->setHasMoreItems((boolean) ($data[JSONConstants::JSON_OBJECTINFOLDERLIST_HAS_MORE_ITEMS] ?? false));
        $objectInFolderList->setNumItems((integer)($data[JSONConstants::JSON_OBJECTINFOLDERLIST_NUM_ITEMS] ?? count($objects)));
        $objectInFolderList->setExtensions($this->convertExtension($data, JSONConstants::getObjectInFolderListKeys()));

        return $objectInFolderList;
    }
185994
protected function createNewItem($itemData)
    {
        $item = array_flip($this->columns);

        foreach ($item as $key => $value) {
            if (isset($itemData[$key])) {
                $item[$key] = $itemData[$key];
            } else {
                $item[$key] = null;
            }
        }

        return $item;
    }
117211
private function fixValues(array $rawData): array
    {
        $data = [];
        foreach ($rawData as $key => $value) {
            if (is_array($value)) {
                $data[$key] = $this->fixValues($value);
            } else {
                $data[$key] = $this->fixValue($value);
            }
        }

        return $data;
    }
269719
public static function FromArray( array $objectData )
   {

      $objectData = \array_change_key_case( $objectData );

      if ( isset( $objectData[ 'x' ] )
        && isset( $objectData[ 'y' ] )
        && isset( $objectData[ 'width' ] )
        && isset( $objectData[ 'height' ] ) )
      {
         return self::Init(
            \intval( $objectData['x'] ),
            \intval( $objectData['y'] ),
            \intval( $objectData['width'] ),
            \intval( $objectData['height'] )
         );
      }

      return false;

   }
87913
private function mergeChildData($nodeData, $childrenData)
    {
        if (is_array($childrenData)) {
            $nodeData = array_merge($nodeData, $childrenData);

            return $nodeData;
        }

        $nodeData = $childrenData;

        return $nodeData;
    }
1096097
private static function getObjectFromArray($data): self
    {
        if (!isset($data['last_access'])) {
            $lastAccess = null;
        } else {
            $lastAccess = new \DateTime($data['last_access']);
        }

        return new self(
            $data['user_id'],
            $data['organization_id'],
            $data['roles'],
            $data['active'],
            $lastAccess
        );
    }