public function activateEndpoint(Endpoint $newActive, $force = false)
    {
        if (!$this->getEndpoints()->contains($newActive)) {
            throw new InputException('Endpoint is not part of this manager');
        }

        if ($force === false && $this->canBeActivated($newActive) === false) {
            throw new InputException('Can not activate this endpoint');
        }

        $this->disableAll();
        $newActive->setStatus(Endpoint::STATUS_ACTIVE);

        return $newActive;
    }
public function activateEndpoint(Endpoint $newActive, $force = false)
    {
        if (!$this->getEndpoints()->contains($newActive)) {
            throw new InputException('Endpoint is not part of this manager');
        }

        if ($force === false && $this->canBeActivated($newActive) === false) {
            throw new InputException('Can not activate this endpoint');
        }

        $this->disableAll();
        $newActive->setStatus(Endpoint::STATUS_ACTIVE);

        return $newActive;
    }
public function activateEndpoint ( Endpoint $ newActive , $ force = false ) { if ( ! $ this -> getEndpoints ( ) -> contains ( $ newActive ) ) { throw new InputException ( 'Endpoint is not part of this manager' ) ; } if ( $ force === false && $ this -> canBeActivated ( $ newActive ) === false ) { throw new InputException ( 'Can not activate this endpoint' ) ; } $ this -> disableAll ( ) ; $ newActive -> setStatus ( Endpoint :: STATUS_ACTIVE ) ; return $ newActive ; }
Try to activate an Endpoint as the active endpoint.
If endpoint status is Error, first check if it can be safely enabled.

@param Endpoint $newActive Endpoint to be enabled
@param bool     $force     when true, skips the cool down check

@throws InputException

@return Endpoint
Try to activate an Endpoint as the active endpoint . If endpoint status is Error first check if it can be safely enabled .