lib/db/cortex.php
public function compare($stack,$cpm_key='_id') {
		if ($stack instanceof CortexCollection)
			$stack = $stack->getAll($cpm_key,true);
		$keys = $this->getAll($cpm_key,true);
		$out = [];
		$new = array_diff($stack,$keys);
		$old = array_diff($keys,$stack);
		if ($new)
			$out['new'] = $new;
		if ($old)
			$out['old'] = $old;
		return $out;
	}
public function compare($stack,$cpm_key='_id') {
		if ($stack instanceof CortexCollection)
			$stack = $stack->getAll($cpm_key,true);
		$keys = $this->getAll($cpm_key,true);
		$out = [];
		$new = array_diff($stack,$keys);
		$old = array_diff($keys,$stack);
		if ($new)
			$out['new'] = $new;
		if ($old)
			$out['old'] = $old;
		return $out;
	}
public function compare ( $ stack , $ cpm_key = '_id' ) { if ( $ stack instanceof CortexCollection ) $ stack = $ stack -> getAll ( $ cpm_key , true ) ; $ keys = $ this -> getAll ( $ cpm_key , true ) ; $ out = [ ] ; $ new = array_diff ( $ stack , $ keys ) ; $ old = array_diff ( $ keys , $ stack ) ; if ( $ new ) $ out [ 'new' ] = $ new ; if ( $ old ) $ out [ 'old' ] = $ old ; return $ out ; }
compare collection with a given ID stack
@param array|CortexCollection $stack
@param string $cpm_key
@return array
compare collection with a given ID stack