Kdyby\Doctrine\Connection::connect PHP Method

connect() public method

public connect ( )
    public function connect()
    {
        if ($this->isConnected()) {
            return FALSE;
        }
        foreach ($this->dbalTypes as $name => $className) {
            if (Type::hasType($name)) {
                Type::overrideType($name, $className);
            } else {
                Type::addType($name, $className);
            }
        }
        parent::connect();
        $platform = $this->getDatabasePlatform();
        foreach ($this->schemaTypes as $dbType => $doctrineType) {
            $platform->registerDoctrineTypeMapping($dbType, $doctrineType);
        }
        foreach ($this->dbalTypes as $type => $className) {
            $platform->markDoctrineTypeCommented(Type::getType($type));
        }
        return TRUE;
    }

Usage Example

 public function connect()
 {
     if (parent::connect()) {
         $this->onConnect($this);
     }
 }