mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'sf4' of framagit.org:Chill-project/Chill-Main into sf4
This commit is contained in:
commit
f38249026f
@ -36,13 +36,28 @@ class MenuCompilerPass implements CompilerPassInterface
|
||||
. "container.", MenuComposer::class));
|
||||
}
|
||||
|
||||
$menuComposerDefinition = $container->getDefinition('chill.main.menu_composer');
|
||||
|
||||
$menuComposerDefinition = $container->getDefinition('chill.main.menu_composer');
|
||||
|
||||
$services = [];
|
||||
foreach ($container->findTaggedServiceIds('chill.menu_builder') as $id => $tags) {
|
||||
$class = $container->getDefinition($id)->getClass();
|
||||
$services[] = [
|
||||
'id' => $id,
|
||||
'priority' => $tags[0]['priority'] ?? 100,
|
||||
];
|
||||
}
|
||||
|
||||
usort($services, function ($a, $b) {
|
||||
if ($a['priority'] == $b['priority']) {
|
||||
return 0;
|
||||
}
|
||||
return ($a['priority'] < $b['priority']) ? -1 : 1;
|
||||
});
|
||||
|
||||
foreach ($services as $service) {
|
||||
$class = $container->getDefinition($service['id'])->getClass();
|
||||
foreach ($class::getMenuIds() as $menuId) {
|
||||
$menuComposerDefinition
|
||||
->addMethodCall('addLocalMenuBuilder', [new Reference($id), $menuId]);
|
||||
->addMethodCall('addLocalMenuBuilder', [new Reference($service['id']), $menuId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,14 @@ class User implements AdvancedUserInterface {
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
private $groupCenters;
|
||||
|
||||
|
||||
/**
|
||||
* Array where SAML attributes's data are stored
|
||||
* @var array
|
||||
*
|
||||
* @ORM\Column(type="json_array", nullable=true)
|
||||
*/
|
||||
private $attributes;
|
||||
|
||||
/**
|
||||
* User constructor.
|
||||
@ -346,4 +353,31 @@ class User implements AdvancedUserInterface {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set attributes
|
||||
*
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return Report
|
||||
*/
|
||||
public function setAttributes($attributes)
|
||||
{
|
||||
$this->attributes = $attributes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get attributes
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAttributes()
|
||||
{
|
||||
if ($this->attributes === null) {
|
||||
$this->attributes = [];
|
||||
}
|
||||
|
||||
return $this->attributes;
|
||||
}
|
||||
}
|
||||
|
30
migrations/Version20210304085819.php
Normal file
30
migrations/Version20210304085819.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20210304085819 extends AbstractMigration
|
||||
{
|
||||
public function getDescription() : string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
$this->addSql('ALTER TABLE users ADD attributes JSONB DEFAULT NULL');
|
||||
$this->addSql('COMMENT ON COLUMN users.attributes IS \'(DC2Type:json_array)\'');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
$this->addSql('ALTER TABLE users DROP attributes');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user