diff --git a/Entities/Admin.php b/Entities/Admin.php index 33d032e..a83fe35 100644 --- a/Entities/Admin.php +++ b/Entities/Admin.php @@ -43,20 +43,20 @@ columns: ['identity_number', 'site_id'] )] #[Index( - columns: ['username', 'status', 'role', 'first_name', 'last_name', 'site_id'], - name: 'index_username_status_role_first_name_last_name_site_id' + name: 'index_username_status_role_first_name_last_name_site_id', + columns: ['username', 'status', 'role', 'first_name', 'last_name', 'site_id'] )] #[Index( - columns: ['attachment_id'], - name: 'relation_admins_attachment_id_attachments_id' + name: 'relation_admins_attachment_id_attachments_id', + columns: ['attachment_id'] )] #[Index( - columns: ['role'], - name: 'relation_admins_role_roles_identity' + name: 'relation_admins_role_roles_identity', + columns: ['role'] )] #[Index( - columns: ['site_id'], - name: 'relation_admins_site_id_sites_id' + name: 'relation_admins_site_id_sites_id', + columns: ['site_id'] )] #[HasLifecycleCallbacks] class Admin extends AbstractUser diff --git a/Entities/AdminLog.php b/Entities/AdminLog.php index e8d9349..d5d31b3 100644 --- a/Entities/AdminLog.php +++ b/Entities/AdminLog.php @@ -21,12 +21,12 @@ ] )] #[Index( - columns: ['user_id'], - name: 'relation_admin_logs_user_id_admins_id' + name: 'relation_admin_logs_user_id_admins_id', + columns: ['user_id'] )] #[Index( - columns: ['user_id', 'name', 'type'], - name: 'index_user_id_name_type' + name: 'index_user_id_name_type', + columns: ['user_id', 'name', 'type'] )] #[HasLifecycleCallbacks] class AdminLog extends AbstractUserBasedLog @@ -50,7 +50,7 @@ class AdminLog extends AbstractUserBasedLog cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' diff --git a/Entities/AdminMeta.php b/Entities/AdminMeta.php index 43b9401..69165dc 100644 --- a/Entities/AdminMeta.php +++ b/Entities/AdminMeta.php @@ -28,12 +28,12 @@ ] )] #[Index( - columns: ['name'], - name: 'index_name' + name: 'index_name', + columns: ['name'] )] #[Index( - columns: ['user_id'], - name: 'relation_admin_meta_user_id_admins_id' + name: 'relation_admin_meta_user_id_admins_id', + columns: ['user_id'] )] #[HasLifecycleCallbacks] /** @@ -74,7 +74,7 @@ class AdminMeta extends AbstractBasedMeta cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'EAGER' diff --git a/Entities/AdminOnlineActivity.php b/Entities/AdminOnlineActivity.php index 42f4b34..87f2c1a 100644 --- a/Entities/AdminOnlineActivity.php +++ b/Entities/AdminOnlineActivity.php @@ -21,16 +21,16 @@ ] )] #[Index( - columns: ['updated_at'], - name: 'index_updated_at' + name: 'index_updated_at', + columns: ['updated_at'] )] #[Index( - columns: ['user_id', 'name', 'created_at', 'updated_at'], - name: 'index_user_id_name_created_at_updated_at' + name: 'index_user_id_name_created_at_updated_at', + columns: ['user_id', 'name', 'created_at', 'updated_at'] )] #[Index( - columns: ['user_id'], - name: 'relation_admin_online_activities_user_id_admins_id' + name: 'relation_admin_online_activities_user_id_admins_id', + columns: ['user_id'] )] #[HasLifecycleCallbacks] class AdminOnlineActivity extends AbstractBasedOnlineActivity @@ -54,7 +54,7 @@ class AdminOnlineActivity extends AbstractBasedOnlineActivity cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' diff --git a/Entities/Capability.php b/Entities/Capability.php index 94a8fa7..4f40923 100644 --- a/Entities/Capability.php +++ b/Entities/Capability.php @@ -50,16 +50,16 @@ ] )] #[Index( - columns: ['identity', 'site_id'], - name: 'index_identity_site_id' + name: 'index_identity_site_id', + columns: ['identity', 'site_id'] )] #[Index( - columns: ['site_id'], - name: 'relation_capabilities_site_id_sites_id' + name: 'relation_capabilities_site_id_sites_id', + columns: ['site_id'] )] #[Index( - columns: ['type'], - name: 'index_type' + name: 'index_type', + columns: ['type'] )] #[HasLifecycleCallbacks] class Capability extends AbstractEntity implements CapabilityEntityInterface @@ -154,11 +154,11 @@ class Capability extends AbstractEntity implements CapabilityEntityInterface * @var ?Collection $roleCapability */ #[OneToMany( - mappedBy: 'capability', targetEntity: RoleCapability::class, + mappedBy: 'capability', cascade: [ 'detach', - 'merge', + // "merge", 'persist', 'remove', ], diff --git a/Entities/Options.php b/Entities/Options.php index a2a0731..4417638 100644 --- a/Entities/Options.php +++ b/Entities/Options.php @@ -14,7 +14,6 @@ use Doctrine\ORM\Mapping\JoinColumn; use Doctrine\ORM\Mapping\ManyToOne; use Doctrine\ORM\Mapping\Table; -use Doctrine\ORM\Mapping\UniqueConstraint; /** * @property-read string $name @@ -34,8 +33,8 @@ ] )] #[Index( - columns: ['site_id'], - name: 'relation_options_site_id_sites_id' + name: 'relation_options_site_id_sites_id', + columns: ['site_id'] )] #[HasLifecycleCallbacks] class Options extends AbstractEntity diff --git a/Entities/Role.php b/Entities/Role.php index b714d76..1beb975 100644 --- a/Entities/Role.php +++ b/Entities/Role.php @@ -22,7 +22,6 @@ use Doctrine\ORM\Mapping\PrePersist; use Doctrine\ORM\Mapping\PreUpdate; use Doctrine\ORM\Mapping\Table; -use Doctrine\ORM\Mapping\UniqueConstraint; #[Entity] #[Table( @@ -39,12 +38,12 @@ ] )] #[Index( - columns: ['identity', 'site_id'], - name: 'index_identity_site_id' + name: 'index_identity_site_id', + columns: ['identity', 'site_id'] )] #[Index( - columns: ['site_id'], - name: 'relation_roles_site_id_sites_id' + name: 'relation_roles_site_id_sites_id', + columns: ['site_id'] )] #[HasLifecycleCallbacks] /** @@ -127,11 +126,11 @@ class Role extends AbstractEntity implements RoleInterface protected ?Site $site = null; #[OneToMany( - mappedBy: 'role', targetEntity: RoleCapability::class, + mappedBy: 'role', cascade: [ 'detach', - 'merge', + // "merge", 'persist', 'remove', ], diff --git a/Entities/RoleCapability.php b/Entities/RoleCapability.php index 3b19988..17fc40a 100644 --- a/Entities/RoleCapability.php +++ b/Entities/RoleCapability.php @@ -30,12 +30,12 @@ ] )] #[Index( - columns: ['role_identity', 'site_id'], - name: 'relation_role_capabilities_identity_roles_identity_sites_id' + name: 'relation_role_capabilities_identity_roles_identity_sites_id', + columns: ['role_identity', 'site_id'] )] #[Index( - columns: ['capability_identity', 'site_id'], - name: 'relation_roles_cap_cap_id_capabilities_identity_site_id' + name: 'relation_roles_cap_cap_id_capabilities_identity_site_id', + columns: ['capability_identity', 'site_id'] )] #[HasLifecycleCallbacks] class RoleCapability extends AbstractEntity @@ -95,7 +95,7 @@ class RoleCapability extends AbstractEntity cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' @@ -132,7 +132,7 @@ class RoleCapability extends AbstractEntity cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' diff --git a/Entities/Site.php b/Entities/Site.php index 466c671..c2c3e8c 100644 --- a/Entities/Site.php +++ b/Entities/Site.php @@ -60,16 +60,16 @@ columns: ['domain'], )] #[Index( - columns: ['user_id'], - name: 'relation_sites_user_id_admins_id' + name: 'relation_sites_user_id_admins_id', + columns: ['user_id'] )] #[Index( - columns: ['domain', 'domain_alias'], - name: 'index_domain_domain_alias' + name: 'index_domain_domain_alias', + columns: ['domain', 'domain_alias'] )] #[Index( - columns: ['name', 'domain', 'domain_alias', 'status'], - name: 'index_name_domain_domain_alias_status' + name: 'index_name_domain_domain_alias_status', + columns: ['name', 'domain', 'domain_alias', 'status'] )] #[HasLifecycleCallbacks] class Site extends AbstractEntity implements IdentityBasedEntityInterface, AvailabilityStatusEntityInterface @@ -363,11 +363,12 @@ final public function isPostLoad(): bool return $this->postLoad; } + /** @noinspection PhpUnusedParameterInspection */ #[PostLoad] final public function finalPostLoaded(PostLoadEventArgs $postLoadEventArgs): void { - print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)); - exit; +// print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)); +// exit; $this->postLoad = true; } } diff --git a/Entities/User.php b/Entities/User.php index bc73393..fca5497 100644 --- a/Entities/User.php +++ b/Entities/User.php @@ -50,24 +50,24 @@ columns: ['identity_number', 'site_id'] )] #[Index( - columns: ['username', 'status', 'role', 'first_name', 'last_name', 'site_id'], - name: 'index_username_status_role_first_name_last_name_site_id' + name: 'index_username_status_role_first_name_last_name_site_id', + columns: ['username', 'status', 'role', 'first_name', 'last_name', 'site_id'] )] #[Index( - columns: ['related_user_id'], - name: 'relation_users_related_user_id_users_id' + name: 'relation_users_related_user_id_users_id', + columns: ['related_user_id'] )] #[Index( - columns: ['attachment_id'], - name: 'relation_users_attachment_id_user_attachments_id' + name: 'relation_users_attachment_id_user_attachments_id', + columns: ['attachment_id'] )] #[Index( - columns: ['role'], - name: 'relation_users_role_roles_identity' + name: 'relation_users_role_roles_identity', + columns: ['role'] )] #[Index( - columns: ['site_id'], - name: 'relation_users_site_id_sites_id' + name: 'relation_users_site_id_sites_id', + columns: ['site_id'] )] #[HasLifecycleCallbacks] class User extends AbstractUser @@ -345,10 +345,8 @@ public function relationIdCheck( ->update($this::class, 'x') ->set('x.related_user_id', ':val') ->where('x.id = :id') - ->setParameters([ - 'val' => null, - 'id' => $this->getId(), - ]); + ->setParameter('val', null) + ->setParameter('id', $this->getId()); $date = $this->getUpdatedAt(); /** @noinspection PhpConditionAlreadyCheckedInspection */ if ($date instanceof DateTimeInterface) { diff --git a/Entities/UserLog.php b/Entities/UserLog.php index 6ac6cc0..4f8a272 100644 --- a/Entities/UserLog.php +++ b/Entities/UserLog.php @@ -21,12 +21,12 @@ ], )] #[Index( - columns: ['user_id'], - name: 'relation_user_logs_user_id_users_id' + name: 'relation_user_logs_user_id_users_id', + columns: ['user_id'] )] #[Index( - columns: ['user_id', 'name', 'type'], - name: 'index_user_id_name_type' + name: 'index_user_id_name_type', + columns: ['user_id', 'name', 'type'] )] #[HasLifecycleCallbacks] class UserLog extends AbstractUserBasedLog @@ -50,7 +50,7 @@ class UserLog extends AbstractUserBasedLog cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' diff --git a/Entities/UserMeta.php b/Entities/UserMeta.php index 9223717..32ab95d 100644 --- a/Entities/UserMeta.php +++ b/Entities/UserMeta.php @@ -28,12 +28,12 @@ ] )] #[Index( - columns: ['name'], - name: 'index_name' + name: 'index_name', + columns: ['name'] )] #[Index( - columns: ['user_id'], - name: 'relation_user_meta_user_id_users_id' + name: 'relation_user_meta_user_id_users_id', + columns: ['user_id'] )] #[HasLifecycleCallbacks] /** @@ -74,7 +74,7 @@ class UserMeta extends AbstractBasedMeta cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'EAGER' diff --git a/Entities/UserOnlineActivity.php b/Entities/UserOnlineActivity.php index 4d93526..72dcc9f 100644 --- a/Entities/UserOnlineActivity.php +++ b/Entities/UserOnlineActivity.php @@ -20,16 +20,16 @@ ] )] #[Index( - columns: ['updated_at'], - name: 'index_updated_at' + name: 'index_updated_at', + columns: ['updated_at'] )] #[Index( - columns: ['user_id', 'name', 'created_at', 'updated_at'], - name: 'index_user_id_name_created_at_updated_at' + name: 'index_user_id_name_created_at_updated_at', + columns: ['user_id', 'name', 'created_at', 'updated_at'] )] #[Index( - columns: ['user_id'], - name: 'relation_user_online_activities_user_id_users_id' + name: 'relation_user_online_activities_user_id_users_id', + columns: ['user_id'] )] class UserOnlineActivity extends AbstractBasedOnlineActivity { @@ -52,7 +52,7 @@ class UserOnlineActivity extends AbstractBasedOnlineActivity cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'LAZY' diff --git a/Entities/UserTerm.php b/Entities/UserTerm.php index 48b1fcc..a8866d9 100644 --- a/Entities/UserTerm.php +++ b/Entities/UserTerm.php @@ -41,16 +41,16 @@ columns: ['name', 'site_id'] )] #[Index( - columns: ['user_id'], - name: 'relation_user_terms_user_id_admins_id' + name: 'relation_user_terms_user_id_admins_id', + columns: ['user_id'] )] #[Index( - columns: ['site_id'], - name: 'relation_user_terms_site_id_sites_id' + name: 'relation_user_terms_site_id_sites_id', + columns: ['site_id'] )] #[Index( - columns: ['name', 'title', 'status'], - name: 'index_name_title_status' + name: 'index_name_title_status', + columns: ['name', 'title', 'status'] )] #[HasLifecycleCallbacks] /** diff --git a/Entities/UserTermGroup.php b/Entities/UserTermGroup.php index b321343..d130c9b 100644 --- a/Entities/UserTermGroup.php +++ b/Entities/UserTermGroup.php @@ -32,12 +32,12 @@ columns: ['user_id', 'term_id'] )] #[Index( - columns: ['term_id'], - name: 'relation_user_term_groups_term_id_user_terms_id' + name: 'relation_user_term_groups_term_id_user_terms_id', + columns: ['term_id'] )] #[Index( - columns: ['user_id'], - name: 'relation_user_term_groups_user_id_users_id' + name: 'relation_user_term_groups_user_id_users_id', + columns: ['user_id'] )] #[HasLifecycleCallbacks] /** diff --git a/Entities/UserTermGroupMeta.php b/Entities/UserTermGroupMeta.php index b1d41d6..aa7d03d 100644 --- a/Entities/UserTermGroupMeta.php +++ b/Entities/UserTermGroupMeta.php @@ -28,12 +28,12 @@ ] )] #[Index( - columns: ['name'], - name: 'index_name' + name: 'index_name', + columns: ['name'] )] #[Index( - columns: ['term_group_id'], - name: 'relation_user_term_group_meta_term_group_id_user_terms_group_id' + name: 'relation_user_term_group_meta_term_group_id_user_terms_group_id', + columns: ['term_group_id'] )] #[HasLifecycleCallbacks] /** @@ -74,7 +74,7 @@ class UserTermGroupMeta extends AbstractBasedMeta cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'EAGER' diff --git a/Entities/UserTermMeta.php b/Entities/UserTermMeta.php index a576311..cd98cbf 100644 --- a/Entities/UserTermMeta.php +++ b/Entities/UserTermMeta.php @@ -28,12 +28,12 @@ ] )] #[Index( - columns: ['name'], - name: 'index_name' + name: 'index_name', + columns: ['name'] )] #[Index( - columns: ['term_id'], - name: 'relation_user_term_metadata_term_id_user_terms_id' + name: 'relation_user_term_metadata_term_id_user_terms_id', + columns: ['term_id'] )] #[HasLifecycleCallbacks] /** @@ -74,7 +74,7 @@ class UserTermMeta extends AbstractBasedMeta cascade: [ "persist", "remove", - "merge", + // "merge", "detach" ], fetch: 'EAGER' diff --git a/Route/Attributes/DashboardAPI.php b/Route/Attributes/DashboardAPI.php index 0fd67e7..59b3b3c 100644 --- a/Route/Attributes/DashboardAPI.php +++ b/Route/Attributes/DashboardAPI.php @@ -8,5 +8,5 @@ #[Attribute(Attribute::TARGET_CLASS)] final class DashboardAPI extends AbstractAPIAttributes { - const API_SUB_PREFIX = 'dashboard'; + public const API_SUB_PREFIX = 'dashboard'; }