src/Identify.php
public function guessIdentifier(callable $fn = null)
    {
        static $guesser;
        static $table;
        if (isset($table)) {
            return $table;
        }
        if (isset($fn)) {
            $guesser = $fn;
        }
        if (!isset($guesser)) {
            $guesser = function ($class) {
                $class = preg_replace('@\\\\?Model$@', '', $class);
                return Helper::normalize($class);
            };
        }
        $class = get_class($this);
        if (strpos($class, '@anonymous') !== false) {
            $class = (new ReflectionClass($this))->getParentClass()->name;
        }
        return $guesser($class);
    }
public function guessIdentifier(callable $fn = null)
    {
        static $guesser;
        static $table;
        if (isset($table)) {
            return $table;
        }
        if (isset($fn)) {
            $guesser = $fn;
        }
        if (!isset($guesser)) {
            $guesser = function ($class) {
                $class = preg_replace('@\\\\?Model$@', '', $class);
                return Helper::normalize($class);
            };
        }
        $class = get_class($this);
        if (strpos($class, '@anonymous') !== false) {
            $class = (new ReflectionClass($this))->getParentClass()->name;
        }
        return $guesser($class);
    }
public function guessIdentifier ( callable $ fn = null ) { static $ guesser ; static $ table ; if ( isset ( $ table ) ) { return $ table ; } if ( isset ( $ fn ) ) { $ guesser = $ fn ; } if ( ! isset ( $ guesser ) ) { $ guesser = function ( $ class ) { $ class = preg_replace ( '@\\\\?Model$@' , '' , $ class ) ; return Helper :: normalize ( $ class ) ; } ; } $ class = get_class ( $ this ) ; if ( strpos ( $ class , '@anonymous' ) !== false ) { $ class = ( new ReflectionClass ( $ this ) ) -> getParentClass ( ) -> name ; } return $ guesser ( $ class ) ; }
Return the guesstimated identifier, optionally by using the callback
passed as an argument.

@param callable $fn Optional callback doing the guesstimating.
@return string A guesstimated identifier.
Return the guesstimated identifier optionally by using the callback passed as an argument .