Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save custom objects using custom doctrine type mappings Remove eb5 #1167

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,19 @@ doctrine:
mapping_types:
enum: string
types:
engineblock_attribute_release_policy: OpenConext\EngineBlockBundle\Doctrine\Type\AttributeReleasePolicyType
engineblock_certificate_array: OpenConext\EngineBlockBundle\Doctrine\Type\CertificateArrayType
engineblock_collab_person_id: OpenConext\EngineBlockBundle\Doctrine\Type\CollabPersonIdType
engineblock_collab_person_uuid: OpenConext\EngineBlockBundle\Doctrine\Type\CollabPersonUuidType
engineblock_contact_person_array: OpenConext\EngineBlockBundle\Doctrine\Type\ContactPersonArrayType
engineblock_indexed_service_array: OpenConext\EngineBlockBundle\Doctrine\Type\IndexedServiceArrayType
engineblock_logo: OpenConext\EngineBlockBundle\Doctrine\Type\LogoType
engineblock_metadata_coins: OpenConext\EngineBlockBundle\Doctrine\Type\MetadataCoinType
engineblock_organization: OpenConext\EngineBlockBundle\Doctrine\Type\OrganizationType
engineblock_requested_attribute_array: OpenConext\EngineBlockBundle\Doctrine\Type\RequestedAttributeArrayType
engineblock_service: OpenConext\EngineBlockBundle\Doctrine\Type\ServiceType
engineblock_service_array: OpenConext\EngineBlockBundle\Doctrine\Type\ServiceArrayType
engineblock_shib_md_scope_array: OpenConext\EngineBlockBundle\Doctrine\Type\ShibMdScopeArrayType
orm:
auto_generate_proxy_classes: "%kernel.debug%"
proxy_dir: '%kernel.cache_dir%/doctrine/orm/Proxies'
Expand Down
28 changes: 28 additions & 0 deletions database/DoctrineMigrations/Version20211019150744.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);

namespace OpenConext\EngineBlock\Doctrine\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211019150744 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE sso_provider_roles_eb6 (id INT AUTO_INCREMENT NOT NULL, entity_id VARCHAR(255) NOT NULL, name_nl VARCHAR(255) DEFAULT NULL, name_en VARCHAR(255) DEFAULT NULL, name_pt VARCHAR(255) DEFAULT NULL, description_nl VARCHAR(255) DEFAULT NULL, description_en VARCHAR(255) DEFAULT NULL, description_pt VARCHAR(255) DEFAULT NULL, display_name_nl VARCHAR(255) DEFAULT NULL, display_name_en VARCHAR(255) DEFAULT NULL, display_name_pt VARCHAR(255) DEFAULT NULL, logo LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_logo)\', organization_nl_name LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_organization)\', organization_en_name LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_organization)\', organization_pt_name LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_organization)\', keywords_nl VARCHAR(255) DEFAULT NULL, keywords_en VARCHAR(255) DEFAULT NULL, keywords_pt VARCHAR(255) DEFAULT NULL, certificates LONGTEXT NOT NULL COMMENT \'(DC2Type:engineblock_certificate_array)\', workflow_state VARCHAR(255) NOT NULL, contact_persons LONGTEXT NOT NULL COMMENT \'(DC2Type:engineblock_contact_person_array)\', name_id_format VARCHAR(255) DEFAULT NULL, name_id_formats LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', single_logout_service LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_service)\', requests_must_be_signed TINYINT(1) NOT NULL, manipulation LONGTEXT DEFAULT NULL, coins LONGTEXT NOT NULL COMMENT \'(DC2Type:engineblock_metadata_coins)\', type VARCHAR(255) NOT NULL, attribute_release_policy LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_attribute_release_policy)\', assertion_consumer_services LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_indexed_service_array)\', allowed_idp_entity_ids LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', allow_all TINYINT(1) DEFAULT NULL, requested_attributes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_requested_attribute_array)\', support_url_en VARCHAR(255) DEFAULT NULL, support_url_nl VARCHAR(255) DEFAULT NULL, support_url_pt VARCHAR(255) DEFAULT NULL, enabled_in_wayf TINYINT(1) DEFAULT NULL, single_sign_on_services LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_service_array)\', consent_settings LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json_array)\', shib_md_scopes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:engineblock_shib_md_scope_array)\', INDEX idx_sso_provider_roles_eb6_type (type), INDEX idx_sso_provider_roles_eb6_entity_id (entity_id), UNIQUE INDEX idx_sso_provider_roles_eb6_entity_id_type (type, entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('DROP TABLE sso_provider_roles_eb6');
}
}
28 changes: 28 additions & 0 deletions database/DoctrineMigrations/Version20211021115130.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);

namespace OpenConext\EngineBlock\Doctrine\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211021115130 extends AbstractMigration
{
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('DROP TABLE sso_provider_roles_eb5');
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE sso_provider_roles_eb5 (id INT AUTO_INCREMENT NOT NULL, entity_id VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, name_nl VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, name_en VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, name_pt VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, description_nl VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, description_en VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, description_pt VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, display_name_nl VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, display_name_en VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, display_name_pt VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, logo LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:object)\', organization_nl_name LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:object)\', organization_en_name LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:object)\', organization_pt_name LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:object)\', keywords_nl VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, keywords_en VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, keywords_pt VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, certificates LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', workflow_state VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, contact_persons LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', name_id_format VARCHAR(255) CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci`, name_id_formats LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', single_logout_service LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:object)\', requests_must_be_signed TINYINT(1) NOT NULL, manipulation LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, coins LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:engineblock_metadata_coins)\', type VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, attribute_release_policy LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', assertion_consumer_services LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', allowed_idp_entity_ids LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', allow_all TINYINT(1) DEFAULT \'NULL\', requested_attributes LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', support_url_en VARCHAR(255) CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci`, support_url_nl VARCHAR(255) CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci`, support_url_pt VARCHAR(255) CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci`, enabled_in_wayf TINYINT(1) DEFAULT \'NULL\', single_sign_on_services LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', consent_settings LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:json_array)\', shib_md_scopes LONGTEXT CHARACTER SET utf8 DEFAULT \'NULL\' COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:array)\', INDEX idx_sso_provider_roles_type (type), INDEX idx_sso_provider_roles_entity_id (entity_id), UNIQUE INDEX idx_sso_provider_roles_entity_id_type (type, entity_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
}
}
90 changes: 45 additions & 45 deletions src/OpenConext/EngineBlock/Metadata/Entity/AbstractRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@
* @ORM\Entity
* @ORM\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
* @ORM\Table(
* name="sso_provider_roles_eb5",
* name="sso_provider_roles_eb6",
* uniqueConstraints={
* @ORM\UniqueConstraint(
* name="idx_sso_provider_roles_entity_id_type",
* name="idx_sso_provider_roles_eb6_entity_id_type",
* columns={"type", "entity_id"}
* )
* },
* indexes={
* @ORM\Index(
* name="idx_sso_provider_roles_type",
* name="idx_sso_provider_roles_eb6_type",
* columns={"type"}
* ),
* @ORM\Index(
* name="idx_sso_provider_roles_entity_id",
* name="idx_sso_provider_roles_eb6_entity_id",
* columns={"entity_id"}
* ),
* }
Expand Down Expand Up @@ -91,120 +91,120 @@ abstract class AbstractRole
public $entityId;

/**
* @var string
* @ORM\Column(name="name_nl", type="string")
* @var null|string
* @ORM\Column(name="name_nl", type="string", nullable=true)
*/
public $nameNl;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="name_en", type="string")
* @ORM\Column(name="name_en", type="string", nullable=true)
*/
public $nameEn;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="name_pt", type="string")
* @ORM\Column(name="name_pt", type="string", nullable=true)
*/
public $namePt;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="description_nl", type="string")
* @ORM\Column(name="description_nl", type="string", nullable=true)
*/
public $descriptionNl;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="description_en", type="string")
* @ORM\Column(name="description_en", type="string", nullable=true)
*/
public $descriptionEn;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="description_pt", type="string")
* @ORM\Column(name="description_pt", type="string", nullable=true)
*/
public $descriptionPt;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="display_name_nl", type="string")
* @ORM\Column(name="display_name_nl", type="string", nullable=true)
*/
public $displayNameNl;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="display_name_en", type="string")
* @ORM\Column(name="display_name_en", type="string", nullable=true)
*/
public $displayNameEn;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="display_name_pt", type="string")
* @ORM\Column(name="display_name_pt", type="string", nullable=true)
*/
public $displayNamePt;

/**
* @var Logo
* @var null|Logo
*
* @ORM\Column(name="logo", type="object")
* @ORM\Column(name="logo", type="engineblock_logo", nullable=true)
*/
public $logo;

/**
* @var Organization
* @var null|Organization
*
* @ORM\Column(name="organization_nl_name",type="object", nullable=true)
* @ORM\Column(name="organization_nl_name",type="engineblock_organization", nullable=true)
*/
public $organizationNl;

/**
* @var Organization
* @var null|Organization
*
* @ORM\Column(name="organization_en_name",type="object", nullable=true)
* @ORM\Column(name="organization_en_name",type="engineblock_organization", nullable=true)
*/
public $organizationEn;

/**
* @var Organization
* @var null|Organization
*
* @ORM\Column(name="organization_pt_name",type="object", nullable=true)
* @ORM\Column(name="organization_pt_name",type="engineblock_organization", nullable=true)
*/
public $organizationPt;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="keywords_nl", type="string")
* @ORM\Column(name="keywords_nl", type="string", nullable=true)
*/
public $keywordsNl;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="keywords_en", type="string")
* @ORM\Column(name="keywords_en", type="string", nullable=true)
*/
public $keywordsEn;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="keywords_pt", type="string")
* @ORM\Column(name="keywords_pt", type="string", nullable=true)
*/
public $keywordsPt;

/**
* @var X509Certificate[]
*
* @ORM\Column(name="certificates", type="array")
* @ORM\Column(name="certificates", type="engineblock_certificate_array")
*/
public $certificates = array();

Expand All @@ -218,28 +218,28 @@ abstract class AbstractRole
/**
* @var ContactPerson[]
*
* @ORM\Column(name="contact_persons", type="array")
* @ORM\Column(name="contact_persons", type="engineblock_contact_person_array")
*/
public $contactPersons;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="name_id_format", type="string", nullable=true)
*/
public $nameIdFormat;

/**
* @var string[]
* @var null|string[]
*
* @ORM\Column(name="name_id_formats", type="array")
* @ORM\Column(name="name_id_formats", type="json", nullable=true)
*/
public $supportedNameIdFormats;

/**
* @var Service
* @var null|Service
*
* @ORM\Column(name="single_logout_service", type="object", nullable=true)
* @ORM\Column(name="single_logout_service", type="engineblock_service", nullable=true)
*/
public $singleLogoutService;

Expand All @@ -251,9 +251,9 @@ abstract class AbstractRole
public $requestsMustBeSigned = false;

/**
* @var string
* @var null|string
*
* @ORM\Column(name="manipulation", type="text")
* @ORM\Column(name="manipulation", type="text", nullable=true)
*/
public $manipulation;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class IdentityProvider extends AbstractRole
/**
* @var Service[]
*
* @ORM\Column(name="single_sign_on_services", type="array")
* @ORM\Column(name="single_sign_on_services", type="engineblock_service_array")
*/
public $singleSignOnServices = array();

Expand All @@ -82,7 +82,7 @@ class IdentityProvider extends AbstractRole
/**
* @var ShibMdScope[]
*
* @ORM\Column(name="shib_md_scopes", type="array")
* @ORM\Column(name="shib_md_scopes", type="engineblock_shib_md_scope_array")
*/
public $shibMdScopes = array();

Expand Down
10 changes: 5 additions & 5 deletions src/OpenConext/EngineBlock/Metadata/Entity/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ class ServiceProvider extends AbstractRole
/**
* @var null|AttributeReleasePolicy
*
* @ORM\Column(name="attribute_release_policy", type="array")
* @ORM\Column(name="attribute_release_policy", type="engineblock_attribute_release_policy", nullable=true)
*/
public $attributeReleasePolicy;

/**
* @var IndexedService[]
*
* @ORM\Column(name="assertion_consumer_services", type="array")
* @ORM\Column(name="assertion_consumer_services", type="engineblock_indexed_service_array")
*/
public $assertionConsumerServices;

/**
* @var string[]
* @var null|string[]
*
* @ORM\Column(name="allowed_idp_entity_ids", type="array")
* @ORM\Column(name="allowed_idp_entity_ids", type="json", nullable=true)
*/
public $allowedIdpEntityIds;

Expand All @@ -77,7 +77,7 @@ class ServiceProvider extends AbstractRole
/**
* @var null|RequestedAttribute[]
*
* @ORM\Column(name="requested_attributes", type="array")
* @ORM\Column(name="requested_attributes", type="engineblock_requested_attribute_array", nullable=true)
*/
public $requestedAttributes;

Expand Down
Loading