Attach Connection
@param  object $conn Connection
@param  mixed $inf Info
@return void
770173
public function attach($conn, $inf = null)
    {
        parent::attach($conn, $inf);
        if ($this->maxConcurrency && !$this->overload) {
            if ($this->count() >= $this->maxConcurrency) {
                $this->overload = true;
                $this->disable();
                return;
            }
        }
    }
751021
public function connectAdvanced(array $config)
    {
        if(!isset($config['flags'])){$config['flags'] = null;};
        if(!isset($config['mailbox'])){$config['mailbox'] = null;};
        if(!isset($config['connect'])){
            throw new ImapClientException('Option connect must be installed');
        };
        $connect = new ImapConnect();
        $connect->prepareFlags($config['flags']);
        $connect->prepareMailbox($config['mailbox']);
        $connect->connect($config['connect']);
        $this->imap = $connect->getImap();
        $this->mailbox = $connect->getMailbox();
    }
769677
public static function setConnection($con, $env = null) 
    {
        $env = self::selectEnvironment($env);
        self::$_connection[$env] = $con;

        // just send an exception when not on production mode
        if (in_array($env, array("development","test"))) {
            self::setErrorHandling(\PDO::ERRMODE_EXCEPTION);
        }
    }
246639
public function detach($conn)
    {
        parent::detach($conn);
        if ($this->overload) {
            if (!$this->maxConcurrency || ($this->count() < $this->maxConcurrency)) {
                $this->overload = false;
                $this->enable();
            }
        }
    }
336677
private function Connect()
    {
        $this->conn = parent::getConn();
        $this->delete = $this->conn->prepare($this->delete);
    }
495019
public void connect(IConnection conn) {
        if (conn instanceof RTMPConnection) {
            if (!isConnected()) {
                source = conn;
                SharedObjectMessage msg = new SharedObjectMessage(name, 0, isPersistent());
                msg.addEvent(new SharedObjectEvent(Type.SERVER_CONNECT, null, null));
                Channel c = ((RTMPConnection) conn).getChannel(3);
                c.write(msg);
            } else {
                throw new UnsupportedOperationException("Already connected");
            }
        } else {
            throw new UnsupportedOperationException("Only RTMP connections are supported");
        }
    }
1015184
protected function attachReadStream()
    {
        $this->ThrowOnConnectionInvalid();
        $this->loop->addReadStream($this->connection, function () {
            $this->readToBuffer();
        });
    }
724161
protected function _connect($dsn, array $config)
    {
        $connection = new PDO(
            $dsn,
            $config['username'],
            $config['password'],
            $config['flags']
        );
        $this->setConnection($connection);

        return true;
    }
1108045
private function openConnection(\stdClass $initData)
    {
        $connectionOptions = $this->parseConnectionData($initData);
        if (isset($initData->persistentId) && !empty($initData->persistentId)) {
            $this->persistentConnect($connectionOptions, persistentId);
        } else {
            $this->notPersistentConnect($connectionOptions);
        }
        $this->executePostConnectionOptions($initData);
    }
999839
public function onOpen(ConnectionInterface $conn)
    {
        $this->conn = $conn;

        $this->attach()->throttle()->limit();
    }
752253
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[StructureNodeTableMap::COL_ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . StructureNodeTableMap::COL_ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(StructureNodeTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_TYPE)) {
            $modifiedColumns[':p' . $index++]  = '`type`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_SKILL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`skill_id`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = '`title`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_DESCENDANT_CLASS)) {
            $modifiedColumns[':p' . $index++]  = '`descendant_class`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_structure_node` (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case '`id`':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case '`type`':
                        $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
                        break;
                    case '`skill_id`':
                        $stmt->bindValue($identifier, $this->skill_id, PDO::PARAM_INT);
                        break;
                    case '`title`':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case '`descendant_class`':
                        $stmt->bindValue($identifier, $this->descendant_class, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        try {
            $pk = $con->lastInsertId();
        } catch (Exception $e) {
            throw new PropelException('Unable to get autoincrement id.', 0, $e);
        }
        $this->setId($pk);

        $this->setNew(false);
    }
768775
public function onMessage(ConnectionInterface $conn, $input)
    {
        $this->console->comment(sprintf('Message from %d: %s', $conn->resourceId, $input));

        if ($this->isThrottled($conn, 'onMessage')) {
            $this->console->info(sprintf('Message throttled: %d', $conn->resourceId));
            $this->send($conn, trans('ratchet::messages.tooManyMessages'));
            $this->throttled = true;

            if (config('ratchet.abortOnMessageThrottle')) {
                $this->abort($conn);
            }
        }
    }
485863
public function handleEnd($conn) {
        try {
            $this->app->onClose($conn->decor);
        } catch (\Exception $e) {
            $this->handleError($e, $conn);
        }

        unset($conn->decor);
    }
760828
private function connect()
    {
        $this->conn = parent::getConn();
        $this->update = $this->conn->prepare($this->update);
    }
1012863
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[MxmapTableMap::COL_ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . MxmapTableMap::COL_ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(MxmapTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKUID)) {
            $modifiedColumns[':p' . $index++]  = 'trackUID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_GBXMAPNAME)) {
            $modifiedColumns[':p' . $index++]  = 'gbxMapName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKID)) {
            $modifiedColumns[':p' . $index++]  = 'trackID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_USERID)) {
            $modifiedColumns[':p' . $index++]  = 'userID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_USERNAME)) {
            $modifiedColumns[':p' . $index++]  = 'username';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UPLOADEDAT)) {
            $modifiedColumns[':p' . $index++]  = 'uploadedAt';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UPDATEDAT)) {
            $modifiedColumns[':p' . $index++]  = 'updatedAt';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_MAPTYPE)) {
            $modifiedColumns[':p' . $index++]  = 'mapType';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TITLEPACK)) {
            $modifiedColumns[':p' . $index++]  = 'titlePack';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_STYLENAME)) {
            $modifiedColumns[':p' . $index++]  = 'styleName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_DISPLAYCOST)) {
            $modifiedColumns[':p' . $index++]  = 'displayCost';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_MODNAME)) {
            $modifiedColumns[':p' . $index++]  = 'modName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LIGHTMAP)) {
            $modifiedColumns[':p' . $index++]  = 'lightMap';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EXEVERSION)) {
            $modifiedColumns[':p' . $index++]  = 'exeVersion';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EXEBUILD)) {
            $modifiedColumns[':p' . $index++]  = 'exeBuild';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_ENVIRONMENTNAME)) {
            $modifiedColumns[':p' . $index++]  = 'environmentName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_VEHICLENAME)) {
            $modifiedColumns[':p' . $index++]  = 'vehicleName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UNLIMITERREQUIRED)) {
            $modifiedColumns[':p' . $index++]  = 'unlimiterRequired';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_ROUTENAME)) {
            $modifiedColumns[':p' . $index++]  = 'routeName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LENGTHNAME)) {
            $modifiedColumns[':p' . $index++]  = 'lengthName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LAPS)) {
            $modifiedColumns[':p' . $index++]  = 'laps';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_DIFFICULTYNAME)) {
            $modifiedColumns[':p' . $index++]  = 'difficultyName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYTYPENAME)) {
            $modifiedColumns[':p' . $index++]  = 'replayTypeName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRID)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRTIME)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRTime';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRUSERID)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRUserID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRUSERNAME)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRUsername';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_RATINGVOTECOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'ratingVoteCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_RATINGVOTEAVERAGE)) {
            $modifiedColumns[':p' . $index++]  = 'ratingVoteAverage';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'replayCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKVALUE)) {
            $modifiedColumns[':p' . $index++]  = 'trackValue';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_COMMENTS)) {
            $modifiedColumns[':p' . $index++]  = 'comments';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_COMMENTSCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'commentsCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_AWARDCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'awardCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASSCREENSHOT)) {
            $modifiedColumns[':p' . $index++]  = 'hasScreenshot';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASTHUMBNAIL)) {
            $modifiedColumns[':p' . $index++]  = 'hasThumbnail';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASGHOSTBLOCKS)) {
            $modifiedColumns[':p' . $index++]  = 'hasGhostblocks';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'embeddedObjectsCount';
        }

        $sql = sprintf(
            'INSERT INTO mxmap (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'id':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'trackUID':
                        $stmt->bindValue($identifier, $this->trackuid, PDO::PARAM_STR);
                        break;
                    case 'gbxMapName':
                        $stmt->bindValue($identifier, $this->gbxmapname, PDO::PARAM_STR);
                        break;
                    case 'trackID':
                        $stmt->bindValue($identifier, $this->trackid, PDO::PARAM_INT);
                        break;
                    case 'userID':
                        $stmt->bindValue($identifier, $this->userid, PDO::PARAM_INT);
                        break;
                    case 'username':
                        $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                        break;
                    case 'uploadedAt':
                        $stmt->bindValue($identifier, $this->uploadedat ? $this->uploadedat->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'updatedAt':
                        $stmt->bindValue($identifier, $this->updatedat ? $this->updatedat->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'mapType':
                        $stmt->bindValue($identifier, $this->maptype, PDO::PARAM_STR);
                        break;
                    case 'titlePack':
                        $stmt->bindValue($identifier, $this->titlepack, PDO::PARAM_STR);
                        break;
                    case 'styleName':
                        $stmt->bindValue($identifier, $this->stylename, PDO::PARAM_STR);
                        break;
                    case 'displayCost':
                        $stmt->bindValue($identifier, $this->displaycost, PDO::PARAM_INT);
                        break;
                    case 'modName':
                        $stmt->bindValue($identifier, $this->modname, PDO::PARAM_STR);
                        break;
                    case 'lightMap':
                        $stmt->bindValue($identifier, $this->lightmap, PDO::PARAM_INT);
                        break;
                    case 'exeVersion':
                        $stmt->bindValue($identifier, $this->exeversion, PDO::PARAM_STR);
                        break;
                    case 'exeBuild':
                        $stmt->bindValue($identifier, $this->exebuild, PDO::PARAM_STR);
                        break;
                    case 'environmentName':
                        $stmt->bindValue($identifier, $this->environmentname, PDO::PARAM_STR);
                        break;
                    case 'vehicleName':
                        $stmt->bindValue($identifier, $this->vehiclename, PDO::PARAM_STR);
                        break;
                    case 'unlimiterRequired':
                        $stmt->bindValue($identifier, (int) $this->unlimiterrequired, PDO::PARAM_INT);
                        break;
                    case 'routeName':
                        $stmt->bindValue($identifier, $this->routename, PDO::PARAM_STR);
                        break;
                    case 'lengthName':
                        $stmt->bindValue($identifier, $this->lengthname, PDO::PARAM_STR);
                        break;
                    case 'laps':
                        $stmt->bindValue($identifier, $this->laps, PDO::PARAM_INT);
                        break;
                    case 'difficultyName':
                        $stmt->bindValue($identifier, $this->difficultyname, PDO::PARAM_STR);
                        break;
                    case 'replayTypeName':
                        $stmt->bindValue($identifier, $this->replaytypename, PDO::PARAM_STR);
                        break;
                    case 'replayWRID':
                        $stmt->bindValue($identifier, $this->replaywrid, PDO::PARAM_INT);
                        break;
                    case 'replayWRTime':
                        $stmt->bindValue($identifier, $this->replaywrtime, PDO::PARAM_INT);
                        break;
                    case 'replayWRUserID':
                        $stmt->bindValue($identifier, $this->replaywruserid, PDO::PARAM_INT);
                        break;
                    case 'replayWRUsername':
                        $stmt->bindValue($identifier, $this->replaywrusername, PDO::PARAM_STR);
                        break;
                    case 'ratingVoteCount':
                        $stmt->bindValue($identifier, $this->ratingvotecount, PDO::PARAM_INT);
                        break;
                    case 'ratingVoteAverage':
                        $stmt->bindValue($identifier, $this->ratingvoteaverage, PDO::PARAM_STR);
                        break;
                    case 'replayCount':
                        $stmt->bindValue($identifier, $this->replaycount, PDO::PARAM_INT);
                        break;
                    case 'trackValue':
                        $stmt->bindValue($identifier, $this->trackvalue, PDO::PARAM_INT);
                        break;
                    case 'comments':
                        $stmt->bindValue($identifier, $this->comments, PDO::PARAM_STR);
                        break;
                    case 'commentsCount':
                        $stmt->bindValue($identifier, $this->commentscount, PDO::PARAM_INT);
                        break;
                    case 'awardCount':
                        $stmt->bindValue($identifier, $this->awardcount, PDO::PARAM_INT);
                        break;
                    case 'hasScreenshot':
                        $stmt->bindValue($identifier, (int) $this->hasscreenshot, PDO::PARAM_INT);
                        break;
                    case 'hasThumbnail':
                        $stmt->bindValue($identifier, (int) $this->hasthumbnail, PDO::PARAM_INT);
                        break;
                    case 'hasGhostblocks':
                        $stmt->bindValue($identifier, (int) $this->hasghostblocks, PDO::PARAM_INT);
                        break;
                    case 'embeddedObjectsCount':
                        $stmt->bindValue($identifier, $this->embeddedobjectscount, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        try {
            $pk = $con->lastInsertId();
        } catch (Exception $e) {
            throw new PropelException('Unable to get autoincrement id.', 0, $e);
        }
        $this->setId($pk);

        $this->setNew(false);
    }
64273
private function connect()
    {
        $this->conn = parent::getConn();
        $this->create = $this->conn->prepare($this->create);
    }
56744
public function onUnSubscribe(Conn $conn, $topic)
    {
        $topic->broadcast($conn->resourceId . " has left " . $topic->getId());
    }