League\FactoryMuffin\Generators\FactoryGenerator::getId PHP Method

getId() private method

Get the model id.
private getId ( object $model ) : integer | null
$model object The model instance.
return integer | null
    private function getId($model)
    {
        // Check to see if we can get an id via our defined methods
        foreach (self::$methods as $method) {
            if (method_exists($model, $method) && is_callable([$model, $method])) {
                return $model->{$method}();
            }
        }
        // Check to see if we can get an id via our defined properties
        foreach (self::$properties as $property) {
            if (isset($model->{$property})) {
                return $model->{$property};
            }
        }
    }