LeanMapper\Result::cleanReferencingResultsCache PHP Method

cleanReferencingResultsCache() public method

Cleans in-memory cache with referencing results
public cleanReferencingResultsCache ( string | null $table = null, string | null $viaColumn = null )
$table string | null
$viaColumn string | null
    public function cleanReferencingResultsCache($table = null, $viaColumn = null)
    {
        if ($table === null or $viaColumn === null) {
            $this->referencing = $this->index = [];
        } else {
            foreach ($this->referencing as $key => $value) {
                $strategies = '(' . self::STRATEGY_IN . '|' . self::STRATEGY_UNION . ')';
                if (preg_match("~^{$table}\\({$viaColumn}\\){$strategies}(#.*)?\$~", $key)) {
                    unset($this->index[spl_object_hash($this->referencing[$key])]);
                    unset($this->referencing[$key]);
                }
            }
        }
    }