original_string: public function get($alias, array $options = [])
      {
          if (isset($this->_instances[$alias])) {
              if (!empty($options) && $this->_options[$alias] !== $options) {
                  throw new RuntimeException(sprintf(
                      'You cannot configure "%s", it already exists in the registry.',
                      $alias
                  ));
              }
  
              return $this->_instances[$alias];
          }
  
          $this->_options[$alias] = $options;
          list(, $classAlias) = pluginSplit($alias);
          $options = ['alias' => $classAlias] + $options;
  
          if (isset($this->_config[$alias])) {
              $options += $this->_config[$alias];
          }
  
          $className = $this->_getClassName($alias, $options);
          if ($className) {
              $options['className'] = $className;
          } else {
              if (empty($options['className'])) {
                  $options['className'] = Inflector::camelize($alias);
              }
              if (!isset($options['table']) && strpos($options['className'], '\\') === false) {
                  list(, $table) = pluginSplit($options['className']);
                  $options['table'] = Inflector::underscore($table);
              }
              $options['className'] = 'Cake\ORM\Table';
          }
  
          if (empty($options['connection'])) {
              if (!empty($options['connectionName'])) {
                  $connectionName = $options['connectionName'];
              } else {
                  /* @var \Cake\ORM\Table $className */
                  $className = $options['className'];
                  $connectionName = $className::defaultConnectionName();
              }
              $options['connection'] = ConnectionManager::get($connectionName);
          }
          if (empty($options['associations'])) {
              $associations = new AssociationCollection($this);
              $options['associations'] = $associations;
          }
  
          $options['registryAlias'] = $alias;
          $this->_instances[$alias] = $this->_create($options);
  
          if ($options['className'] === 'Cake\ORM\Table') {
              $this->_fallbacked[$alias] = $this->_instances[$alias];
          }
  
          return $this->_instances[$alias];
      }
code: public function get($alias, array $options = [])
      {
          if (isset($this->_instances[$alias])) {
              if (!empty($options) && $this->_options[$alias] !== $options) {
                  throw new RuntimeException(sprintf(
                      'You cannot configure "%s", it already exists in the registry.',
                      $alias
                  ));
              }
  
              return $this->_instances[$alias];
          }
  
          $this->_options[$alias] = $options;
          list(, $classAlias) = pluginSplit($alias);
          $options = ['alias' => $classAlias] + $options;
  
          if (isset($this->_config[$alias])) {
              $options += $this->_config[$alias];
          }
  
          $className = $this->_getClassName($alias, $options);
          if ($className) {
              $options['className'] = $className;
          } else {
              if (empty($options['className'])) {
                  $options['className'] = Inflector::camelize($alias);
              }
              if (!isset($options['table']) && strpos($options['className'], '\\') === false) {
                  list(, $table) = pluginSplit($options['className']);
                  $options['table'] = Inflector::underscore($table);
              }
              $options['className'] = 'Cake\ORM\Table';
          }
  
          if (empty($options['connection'])) {
              if (!empty($options['connectionName'])) {
                  $connectionName = $options['connectionName'];
              } else {
                  /* @var \Cake\ORM\Table $className */
                  $className = $options['className'];
                  $connectionName = $className::defaultConnectionName();
              }
              $options['connection'] = ConnectionManager::get($connectionName);
          }
          if (empty($options['associations'])) {
              $associations = new AssociationCollection($this);
              $options['associations'] = $associations;
          }
  
          $options['registryAlias'] = $alias;
          $this->_instances[$alias] = $this->_create($options);
  
          if ($options['className'] === 'Cake\ORM\Table') {
              $this->_fallbacked[$alias] = $this->_instances[$alias];
          }
  
          return $this->_instances[$alias];
      }
code_tokens: public function get ( $ alias , array $ options = [ ] ) { if ( isset ( $ this -> _instances [ $ alias ] ) ) { if ( ! empty ( $ options ) && $ this -> _options [ $ alias ] !== $ options ) { throw new RuntimeException ( sprintf ( 'You cannot configure "%s", it already exists in the registry.' , $ alias ) ) ; } return $ this -> _instances [ $ alias ] ; } $ this -> _options [ $ alias ] = $ options ; list ( , $ classAlias ) = pluginSplit ( $ alias ) ; $ options = [ 'alias' => $ classAlias ] + $ options ; if ( isset ( $ this -> _config [ $ alias ] ) ) { $ options += $ this -> _config [ $ alias ] ; } $ className = $ this -> _getClassName ( $ alias , $ options ) ; if ( $ className ) { $ options [ 'className' ] = $ className ; } else { if ( empty ( $ options [ 'className' ] ) ) { $ options [ 'className' ] = Inflector :: camelize ( $ alias ) ; } if ( ! isset ( $ options [ 'table' ] ) && strpos ( $ options [ 'className' ] , '\\' ) === false ) { list ( , $ table ) = pluginSplit ( $ options [ 'className' ] ) ; $ options [ 'table' ] = Inflector :: underscore ( $ table ) ; } $ options [ 'className' ] = 'Cake\ORM\Table' ; } if ( empty ( $ options [ 'connection' ] ) ) { if ( ! empty ( $ options [ 'connectionName' ] ) ) { $ connectionName = $ options [ 'connectionName' ] ; } else { /* @var \Cake\ORM\Table $className */ $ className = $ options [ 'className' ] ; $ connectionName = $ className :: defaultConnectionName ( ) ; } $ options [ 'connection' ] = ConnectionManager :: get ( $ connectionName ) ; } if ( empty ( $ options [ 'associations' ] ) ) { $ associations = new AssociationCollection ( $ this ) ; $ options [ 'associations' ] = $ associations ; } $ options [ 'registryAlias' ] = $ alias ; $ this -> _instances [ $ alias ] = $ this -> _create ( $ options ) ; if ( $ options [ 'className' ] === 'Cake\ORM\Table' ) { $ this -> _fallbacked [ $ alias ] = $ this -> _instances [ $ alias ] ; } return $ this -> _instances [ $ alias ] ; }
docstring: Get a table instance from the registry.
  
  Tables are only created once until the registry is flushed.
  This means that aliases must be unique across your application.
  This is important because table associations are resolved at runtime
  and cyclic references need to be handled correctly.
  
  The options that can be passed are the same as in Cake\ORM\Table::__construct(), but the
  `className` key is also recognized.
  
  ### Options
  
  - `className` Define the specific class name to use. If undefined, CakePHP will generate the
  class name based on the alias. For example 'Users' would result in
  `App\Model\Table\UsersTable` being used. If this class does not exist,
  then the default `Cake\ORM\Table` class will be used. By setting the `className`
  option you can define the specific class to use. The className option supports
  plugin short class references {@link Cake\Core\App::shortName()}.
  - `table` Define the table name to use. If undefined, this option will default to the underscored
  version of the alias name.
  - `connection` Inject the specific connection object to use. If this option and `connectionName` are undefined,
  The table class' `defaultConnectionName()` method will be invoked to fetch the connection name.
  - `connectionName` Define the connection name to use. The named connection will be fetched from
  Cake\Datasource\ConnectionManager.
  
  *Note* If your `$alias` uses plugin syntax only the name part will be used as
  key in the registry. This means that if two plugins, or a plugin and app provide
  the same alias, the registry will only store the first instance.
  
  @param string $alias The alias name you want to get.
  @param array $options The options you want to build the table with.
  If a table has already been loaded the options will be ignored.
  @return \Cake\ORM\Table
  @throws \RuntimeException When you try to configure an alias that already exists.
docstring_tokens: Get a table instance from the registry .