original_string: public function matching($assoc, callable $builder = null)
      {
          $result = $this->getEagerLoader()->setMatching($assoc, $builder)->getMatching();
          $this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result);
          $this->_dirty();
  
          return $this;
      }
code: public function matching($assoc, callable $builder = null)
      {
          $result = $this->getEagerLoader()->setMatching($assoc, $builder)->getMatching();
          $this->_addAssociationsToTypeMap($this->getRepository(), $this->getTypeMap(), $result);
          $this->_dirty();
  
          return $this;
      }
code_tokens: public function matching ( $ assoc , callable $ builder = null ) { $ result = $ this -> getEagerLoader ( ) -> setMatching ( $ assoc , $ builder ) -> getMatching ( ) ; $ this -> _addAssociationsToTypeMap ( $ this -> getRepository ( ) , $ this -> getTypeMap ( ) , $ result ) ; $ this -> _dirty ( ) ; return $ this ; }
docstring: Adds filtering conditions to this query to only bring rows that have a relation
  to another from an associated table, based on conditions in the associated table.
  
  This function will add entries in the `contain` graph.
  
  ### Example:
  
  ```
  // Bring only articles that were tagged with 'cake'
  $query->matching('Tags', function ($q) {
  return $q->where(['name' => 'cake']);
  );
  ```
  
  It is possible to filter by deep associations by using dot notation:
  
  ### Example:
  
  ```
  // Bring only articles that were commented by 'markstory'
  $query->matching('Comments.Users', function ($q) {
  return $q->where(['username' => 'markstory']);
  );
  ```
  
  As this function will create `INNER JOIN`, you might want to consider
  calling `distinct` on this query as you might get duplicate rows if
  your conditions don't filter them already. This might be the case, for example,
  of the same user commenting more than once in the same article.
  
  ### Example:
  
  ```
  // Bring unique articles that were commented by 'markstory'
  $query->distinct(['Articles.id'])
  ->matching('Comments.Users', function ($q) {
  return $q->where(['username' => 'markstory']);
  );
  ```
  
  Please note that the query passed to the closure will only accept calling
  `select`, `where`, `andWhere` and `orWhere` on it. If you wish to
  add more complex clauses you can do it directly in the main query.
  
  @param string $assoc The association to filter by
  @param callable|null $builder a function that will receive a pre-made query object
  that can be used to add custom conditions or selecting some fields
  @return $this
docstring_tokens: Adds filtering conditions to this query to only bring rows that have a relation to another from an associated table based on conditions in the associated table .