Skip to content

Instantly share code, notes, and snippets.

View rande's full-sized avatar
🖖
hello!

Thomas rande

🖖
hello!
View GitHub Profile
#config.yml
security.config:
providers:
fos_user:
id: fos_user.user_manager
firewalls:
admin:
pattern: /admin/.*
form_login: true
base_application.config:
entities:
user:
label: User
group: FOS
class: FOS\UserBundle\Admin\Entity\UserAdmin
entity: Application\FOS\UserBundle\Entity\User
controller: FOS\UserBundle\Controller\UserAdminController
options:
diff --git a/Document/UserManager.php b/Document/UserManager.php
index ef28089..c5d5b2d 100644
--- a/Document/UserManager.php
+++ b/Document/UserManager.php
@@ -19,11 +19,13 @@ class UserManager extends BaseUserManager
{
parent::__construct($encoder, $algorithm, $canonicalizer);
- $this->dm = $dm;
- $this->repository = $dm->getRepository($class);
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index ed7dbb9..d61509d 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -295,25 +295,21 @@ abstract class Kernel implements HttpKernelInterface, \Serializable
$isResource = 0 === strpos($path, 'Resources');
- // return the first matching one
- if (true === $first) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php b/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator
index 49b69f2..698e17d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Routing/FileLocator.php
@@ -42,7 +42,8 @@ class FileLocator extends BaseFileLocator
public function locate($file)
{
if ('@' === $file[0]) {
- return $this->kernel->locateResource($file);
+ $ressources = $this->kernel->locateResource($file, null, false);
if($description['edit'] == 'inline') {
$target_object = $description['reflection']->getValue($object);
if(!$target_object) {
$target_object = $description['configuration']->getNewInstance();
}
$target_fields = $description['configuration']->getFormFields();
$target_form = $description['configuration']->getForm($target_object, $target_fields);
<?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
news_application:
type: xml
dir: %kernel.root_dir%/../src/Application/NewsBundle/Resources/config/doctrine/metadata/orm
prefix: Application\NewsBundle\Entity
alias: DExt
news_bundle:
type: xml
dir: %kernel.root_dir%/../src/Bundle/NewsBundle/Resources/config/doctrine/metadata/orm
prefix: Bundle\NewsBundle\Entity
@rande
rande / custom targetEntity
Created November 3, 2010 22:24
custom targetEntity
<?php
namespace Sonata\Bundle\BlogBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Doctrine\Common\EventSubscriber;
class BlogBundle extends Bundle implements EventSubscriber
{
$connection = Doctrine::getTable('sfGuardUser')->getConnection();
$sqls = array(
"INSERT INTO `application_item` (`object_id`,`object_class`,`application_id`) VALUES ('1','MappableObject','4');",
"INSERT INTO `application_item` (`object_id`,`object_class`,`application_id`) VALUES ('2','MappableObject','4');",
"INSERT INTO `application_item` (`object_id`,`object_class`,`application_id`) VALUES ('3','MappableObject','4');",
"INSERT INTO `application_item` (`object_id`,`object_class`,`application_id`) VALUES ('4','MappableObject','4');",
);
array_map(function($sql) use ($connection) {