public static function wrap($bean, $modelClass = null)
    {
        if (is_array($bean)) {
            $collection = new Collection($bean);
            $collection->map(function ($item) use ($modelClass) {
                if ($modelClass) {
                    return new $modelClass($item);
                } else {
                    return new static($item);
                }
            });
            return $collection;
        } elseif ($bean instanceof OODBBean) {
            if ($modelClass) {
                return new $modelClass($bean);
            } else {
                return new static($bean);
            }
        } else {
            return $bean;
        }
    }
public static function wrap($bean, $modelClass = null)
    {
        if (is_array($bean)) {
            $collection = new Collection($bean);
            $collection->map(function ($item) use ($modelClass) {
                if ($modelClass) {
                    return new $modelClass($item);
                } else {
                    return new static($item);
                }
            });
            return $collection;
        } elseif ($bean instanceof OODBBean) {
            if ($modelClass) {
                return new $modelClass($bean);
            } else {
                return new static($bean);
            }
        } else {
            return $bean;
        }
    }
public static function wrap ( $ bean , $ modelClass = null ) { if ( is_array ( $ bean ) ) { $ collection = new Collection ( $ bean ) ; $ collection -> map ( function ( $ item ) use ( $ modelClass ) { if ( $ modelClass ) { return new $ modelClass ( $ item ) ; } else { return new static ( $ item ) ; } } ) ; return $ collection ; } elseif ( $ bean instanceof OODBBean ) { if ( $ modelClass ) { return new $ modelClass ( $ bean ) ; } else { return new static ( $ bean ) ; } } else { return $ bean ; } }
Converts an OODBBean to Model

@param OODBBean|array $bean
@param string $modelClass
@return \static|Collection
Converts an OODBBean to Model