original_string: protected function decorateWhere($method, &$args)
      {
          $column = $args[0];
          $expression = isset($args[1]) ? $args[1] : null;
          $value = isset($args[2]) ? $args[2] : null;
  
          if (!$expression instanceof Entity && !$value instanceof Entity) {
              return;
          }
  
          $entity_class = $this->entity_class;
          $relation = $entity_class::getRelationDefinition($column);
          $column = $relation[3];
          $relation_column = $relation[2];
          if ($expression instanceof Entity) {
              $expression = $expression->getRaw($relation_column);
          } else {
              $value = $value->getRaw($relation_column);
          }
  
          $args = [$column, $expression, $value];
      }
code: protected function decorateWhere($method, &$args)
      {
          $column = $args[0];
          $expression = isset($args[1]) ? $args[1] : null;
          $value = isset($args[2]) ? $args[2] : null;
  
          if (!$expression instanceof Entity && !$value instanceof Entity) {
              return;
          }
  
          $entity_class = $this->entity_class;
          $relation = $entity_class::getRelationDefinition($column);
          $column = $relation[3];
          $relation_column = $relation[2];
          if ($expression instanceof Entity) {
              $expression = $expression->getRaw($relation_column);
          } else {
              $value = $value->getRaw($relation_column);
          }
  
          $args = [$column, $expression, $value];
      }
code_tokens: protected function decorateWhere ( $ method , & $ args ) { $ column = $ args [ 0 ] ; $ expression = isset ( $ args [ 1 ] ) ? $ args [ 1 ] : null ; $ value = isset ( $ args [ 2 ] ) ? $ args [ 2 ] : null ; if ( ! $ expression instanceof Entity && ! $ value instanceof Entity ) { return ; } $ entity_class = $ this -> entity_class ; $ relation = $ entity_class :: getRelationDefinition ( $ column ) ; $ column = $ relation [ 3 ] ; $ relation_column = $ relation [ 2 ] ; if ( $ expression instanceof Entity ) { $ expression = $ expression -> getRaw ( $ relation_column ) ; } else { $ value = $ value -> getRaw ( $ relation_column ) ; } $ args = [ $ column , $ expression , $ value ] ; }
docstring: Modify the arguments of a where method to account for selecting
  by entity objects.
  
  @param $method The where method being called
  @param $args The arguments
docstring_tokens: Modify the arguments of a where method to account for selecting by entity objects .