public static function resolveScope($name, $args=null, $cls=null)
    {
        $conditions = self::getScope($name, $cls);
        if (!$conditions) {
            return null;
        }

        if (is_callable($conditions)) {
            $conditions = $conditions($args);
        }
        return self::where($conditions);
    }
public static function resolveScope($name, $args=null, $cls=null)
    {
        $conditions = self::getScope($name, $cls);
        if (!$conditions) {
            return null;
        }

        if (is_callable($conditions)) {
            $conditions = $conditions($args);
        }
        return self::where($conditions);
    }
public static function resolveScope ( $ name , $ args = null , $ cls = null ) { $ conditions = self :: getScope ( $ name , $ cls ) ; if ( ! $ conditions ) { return null ; } if ( is_callable ( $ conditions ) ) { $ conditions = $ conditions ( $ args ) ; } return self :: where ( $ conditions ) ; }
Resolve a scope, returning a collection

@param string $name of scope
@param mixed  $args arguments to use on callable scopes
@param string $cls  class of scope

@return mixed collection
Resolve a scope returning a collection