Esempio n. 1
0
 /**
  * update the bundle schema specified in param.
  *
  * @param string $bundleName
  */
 public function updateBundleSchema($bundleName)
 {
     if (null === ($bundle = $this->_application->getBundle($bundleName))) {
         return;
     }
     try {
         $schemaTool = new SchemaTool($bundle->getEntityManager());
         $classes = $this->_getBundleSchema($bundle);
         $schemaTool->updateSchema($classes, true);
         unset($schemaTool);
     } catch (\Exception $e) {
     }
 }
 private function addBundleRights($bundle_def, $aclProvider, $securityIdentity)
 {
     if (false === array_key_exists('resources', $bundle_def) || false === array_key_exists('actions', $bundle_def)) {
         return null;
     }
     $actions = $this->getActions($bundle_def['actions']);
     if (0 === count($actions)) {
         $this->writeln('Notice: none actions defined on bundle' . PHP_EOL);
         return array();
     }
     if (true === is_array($bundle_def['resources'])) {
         foreach ($bundle_def['resources'] as $bundle_name) {
             if (null !== ($bundle = $this->bbapp->getBundle($bundle_name))) {
                 $this->addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
             }
         }
     } elseif ('all' === $bundle_def['resources']) {
         foreach ($this->bbapp->getBundles() as $bundle) {
             $this->addObjectAcl($bundle, $aclProvider, $securityIdentity, $actions);
         }
     }
 }