original_string: protected function _checkAssociation(Table $table, $association)
      {
          if (!$table->associations()->has($association)) {
              throw new RuntimeException(sprintf('Table `%s` is not associated with `%s`', get_class($table), $association));
          }
      }
code: protected function _checkAssociation(Table $table, $association)
      {
          if (!$table->associations()->has($association)) {
              throw new RuntimeException(sprintf('Table `%s` is not associated with `%s`', get_class($table), $association));
          }
      }
code_tokens: protected function _checkAssociation ( Table $ table , $ association ) { if ( ! $ table -> associations ( ) -> has ( $ association ) ) { throw new RuntimeException ( sprintf ( 'Table `%s` is not associated with `%s`' , get_class ( $ table ) , $ association ) ) ; } }
docstring: Checks if an association exists.
  
  @throws \RuntimeException If no such association exists for the given table.
  @param \Cake\ORM\Table $table Table object.
  @param string $association Association name.
  @return void
docstring_tokens: Checks if an association exists .