public function createScope($scope, $description = null)
    {
        if ($scopeObject = $this->findScopeByScope($scope)) {
          return $scopeObject;
        }

        $scopeObject = new \OAuth2\ServerBundle\Entity\Scope();
        $scopeObject->setScope($scope);
        $scopeObject->setDescription($description);

        // Store Scope
        $this->em->persist($scopeObject);
        $this->em->flush();

        return $scopeObject;
    }
public function createScope($scope, $description = null)
    {
        if ($scopeObject = $this->findScopeByScope($scope)) {
          return $scopeObject;
        }

        $scopeObject = new \OAuth2\ServerBundle\Entity\Scope();
        $scopeObject->setScope($scope);
        $scopeObject->setDescription($description);

        // Store Scope
        $this->em->persist($scopeObject);
        $this->em->flush();

        return $scopeObject;
    }
public function createScope ( $ scope , $ description = null ) { if ( $ scopeObject = $ this -> findScopeByScope ( $ scope ) ) { return $ scopeObject ; } $ scopeObject = new \ OAuth2 \ ServerBundle \ Entity \ Scope ( ) ; $ scopeObject -> setScope ( $ scope ) ; $ scopeObject -> setDescription ( $ description ) ; // Store Scope $ this -> em -> persist ( $ scopeObject ) ; $ this -> em -> flush ( ) ; return $ scopeObject ; }
Creates a new scope

@param string $scope

@param string $description

@return Scope
Creates a new scope