RedBeanPHP\Repository::processGroups PHP Method

processGroups() protected method

Process groups. Internal function. Processes different kind of groups for storage function. Given a list of original beans and a list of current beans, this function calculates which beans remain in the list (residue), which have been deleted (are in the trashcan) and which beans have been added (additions).
protected processGroups ( array $originals, array $current, array $additions, array $trashcan, array $residue ) : array
$originals array originals
$current array the current beans
$additions array beans that have been added
$trashcan array beans that have been deleted
$residue array beans that have been left untouched
return array
    protected function processGroups($originals, $current, $additions, $trashcan, $residue)
    {
        return array(array_merge($additions, array_diff($current, $originals)), array_merge($trashcan, array_diff($originals, $current)), array_merge($residue, array_intersect($current, $originals)));
    }