Locker\Repository\Statement\Options::getOpt PHP Method

getOpt() public method

Gets an options.
public getOpt ( String $opt ) : Mixed
$opt String Option name.
return Mixed
    public function getOpt($opt)
    {
        return $this->options[$opt];
    }

Usage Example

 /**
  * Constructs a query restricted by the given options.
  * @param [String => Mixed] $opts
  * @return \Jenssegers\Mongodb\Eloquent\Builder
  */
 protected function where(Options $opts)
 {
     $scopes = $opts->getOpt('scopes');
     $query = (new $this->model())->where('lrs_id', new \MongoId($opts->getOpt('lrs_id')));
     if (in_array('all', $scopes) || in_array('all/read', $scopes) || in_array('statements/read', $scopes)) {
         // Get all statements.
     } else {
         if (in_array('statements/read/mine', $scopes)) {
             $query = $query->where('client_id', $opts->getOpt('client')->_id);
         } else {
             throw new Exceptions\Exception('Unauthorized request.', 401);
         }
     }
     return $query;
 }
All Usage Examples Of Locker\Repository\Statement\Options::getOpt