original_string: public function filterByKeywords($name)
      {
          $likeBuilder = $this->app->make(LikeBuilder::class);
          /* @var LikeBuilder $likeBuilder */
          $likes = $likeBuilder->splitKeywordsForLike($name, '\W_');
          if (!empty($likes)) {
              $expr = $this->query->expr();
              $orFields = $expr->orX();
              foreach (['p.handle', 'p.name'] as $fieldName) {
                  $and = $expr->andX();
                  foreach ($likes as $like) {
                      $and->add($expr->like($fieldName, $this->query->createNamedParameter($like)));
                  }
                  $orFields->add($and);
              }
              $this->query->andWhere($orFields);
          }
      }
code: public function filterByKeywords($name)
      {
          $likeBuilder = $this->app->make(LikeBuilder::class);
          /* @var LikeBuilder $likeBuilder */
          $likes = $likeBuilder->splitKeywordsForLike($name, '\W_');
          if (!empty($likes)) {
              $expr = $this->query->expr();
              $orFields = $expr->orX();
              foreach (['p.handle', 'p.name'] as $fieldName) {
                  $and = $expr->andX();
                  foreach ($likes as $like) {
                      $and->add($expr->like($fieldName, $this->query->createNamedParameter($like)));
                  }
                  $orFields->add($and);
              }
              $this->query->andWhere($orFields);
          }
      }
code_tokens: public function filterByKeywords ( $ name ) { $ likeBuilder = $ this -> app -> make ( LikeBuilder :: class ) ; /* @var LikeBuilder $likeBuilder */ $ likes = $ likeBuilder -> splitKeywordsForLike ( $ name , '\W_' ) ; if ( ! empty ( $ likes ) ) { $ expr = $ this -> query -> expr ( ) ; $ orFields = $ expr -> orX ( ) ; foreach ( [ 'p.handle' , 'p.name' ] as $ fieldName ) { $ and = $ expr -> andX ( ) ; foreach ( $ likes as $ like ) { $ and -> add ( $ expr -> like ( $ fieldName , $ this -> query -> createNamedParameter ( $ like ) ) ) ; } $ orFields -> add ( $ and ) ; } $ this -> query -> andWhere ( $ orFields ) ; } }
docstring: Filter the results by keywords.
  
  @param string $name
docstring_tokens: Filter the results by keywords .