Cake\Database\Connection::configName PHP Метод

configName() публичный Метод

{@inheritDoc}
public configName ( )
    public function configName()
    {
        if (empty($this->_config['name'])) {
            return '';
        }
        return $this->_config['name'];
    }

Usage Example

Пример #1
2
 /**
  * Runs the drop and create commands on the fixtures if necessary.
  *
  * @param \Cake\TestSuite\Fixture\TestFixture $fixture the fixture object to create
  * @param Connection $db the datasource instance to use
  * @param array $sources The existing tables in the datasource.
  * @param bool $drop whether drop the fixture if it is already created or not
  * @return void
  */
 protected function _setupTable(TestFixture $fixture, Connection $db, array $sources, $drop = true)
 {
     if (!empty($fixture->created) && in_array($db->configName(), $fixture->created)) {
         return;
     }
     $table = $fixture->table;
     $exists = in_array($table, $sources);
     if ($drop && $exists) {
         $fixture->drop($db);
         $fixture->create($db);
     } elseif (!$exists) {
         $fixture->create($db);
     } else {
         $fixture->created[] = $db->configName();
         $fixture->truncate($db);
     }
 }
All Usage Examples Of Cake\Database\Connection::configName