src/Generators/FactoryGenerator.php
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;
            }
        }
    }
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;
            }
        }
    }
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 ; } } }
Get the model id.

@param object $model The model instance.

@return int|null
Get the model id .