original_string: public function operatorPromote(Query $query, TokenInterface $token)
      {
          $value = strtolower($token->value());
          $conjunction = $token->negated() ? '<>' : '';
          $conditions = [];
  
          if ($value === 'true') {
              $conditions = ["Contents.promote {$conjunction}" => 1];
          } elseif ($value === 'false') {
              $conditions = ['Contents.promote {$conjunction}' => 0];
          }
  
          if (!empty($conditions)) {
              if ($token->where() === 'or') {
                  $query->orWhere($conditions);
              } elseif ($token->where() === 'and') {
                  $query->andWhere($conditions);
              } else {
                  $query->where($conditions);
              }
          }
  
          return $query;
      }
code: public function operatorPromote(Query $query, TokenInterface $token)
      {
          $value = strtolower($token->value());
          $conjunction = $token->negated() ? '<>' : '';
          $conditions = [];
  
          if ($value === 'true') {
              $conditions = ["Contents.promote {$conjunction}" => 1];
          } elseif ($value === 'false') {
              $conditions = ['Contents.promote {$conjunction}' => 0];
          }
  
          if (!empty($conditions)) {
              if ($token->where() === 'or') {
                  $query->orWhere($conditions);
              } elseif ($token->where() === 'and') {
                  $query->andWhere($conditions);
              } else {
                  $query->where($conditions);
              }
          }
  
          return $query;
      }
code_tokens: public function operatorPromote ( Query $ query , TokenInterface $ token ) { $ value = strtolower ( $ token -> value ( ) ) ; $ conjunction = $ token -> negated ( ) ? '<>' : '' ; $ conditions = [ ] ; if ( $ value === 'true' ) { $ conditions = [ "Contents.promote {$conjunction}" => 1 ] ; } elseif ( $ value === 'false' ) { $ conditions = [ 'Contents.promote {$conjunction}' => 0 ] ; } if ( ! empty ( $ conditions ) ) { if ( $ token -> where ( ) === 'or' ) { $ query -> orWhere ( $ conditions ) ; } elseif ( $ token -> where ( ) === 'and' ) { $ query -> andWhere ( $ conditions ) ; } else { $ query -> where ( $ conditions ) ; } } return $ query ; }
docstring: Handles "promote" search operator.
  
  promote:<true|false>
  
  @param \Cake\ORM\Query $query The query object
  @param \Search\Parser\TokenInterface $token Operator token
  @return \Cake\ORM\Query
docstring_tokens: Handles promote search operator .