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));
        }
    }
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));
        }
    }
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 ) ) ; } }
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
Checks if an association exists .