Esempio n. 1
0
 public function format(IFormatterProvider $formatterProvider)
 {
     $this->distinct();
     if (!empty($this->pathList)) {
         $this->where($wherePath = new WhereChain());
         foreach ($this->pathList as $path) {
             $wherePath->orr(new WhereExpression(new DelimiteFragment('file'), 'LIKE', new ParameterFragment($path, $path)));
         }
     }
     if (!empty($this->extensionList)) {
         $this->where($whereExtension = new WhereChain());
         foreach ($this->extensionList as $extension) {
             $extensionFragment = new DelimiteFragment('extension');
             $whereExtension->orr($extension ? new WhereExpression($extensionFragment, '=', new ParameterFragment($extension, $extension)) : new WhereIsNull($extensionFragment));
         }
     }
     if (isset($wherePath) && isset($whereExtension)) {
         $this->where(new WhereGroup($wherePath, 'AND', $whereExtension));
     }
     return parent::format($formatterProvider);
 }