Skip to content

[NO JIRA] Deprecations #22

Merged
merged 1 commit into from
Apr 27, 2022
Merged
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
4 changes: 2 additions & 2 deletions app/src/Command/DatabaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
$toSql = $schema->toSql($conn->getDatabasePlatform());

// SchemaManager provides info about the database
$sm = $conn->getSchemaManager();
$sm = $conn->createSchemaManager();

// The is the current database representation
$curSchema = $sm->createSchema();
Expand Down Expand Up @@ -282,7 +282,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
$io->out("Skipping sequence drop");
} else {
if($doSQL) {
$stmt = $conn->query($sql);
$stmt = $conn->executeQuery($sql);
// $stmt just returns the query string so we don't bother examining it
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/Command/TransmogrifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
// data here, and also we're executing a maintenance operation (so query
// optimization is less important)
$outsql = "ALTER SEQUENCE " . $t . "_id_seq RESTART WITH " . $max;
$this->outconn->query($outsql);
$this->outconn->executeQuery($outsql);

// Run any post processing functions for the table.

Expand Down
2 changes: 1 addition & 1 deletion app/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function getPrimaryLink(bool $lookup=false) {
// Look up the link value to find the related entity

$linkTableName = $this->$modelsName->getPrimaryLinkTableName($this->cur_pl->attr);
$linkTable = TableRegistry::get($linkTableName);
$linkTable = $this->getTableLocator()->get($linkTableName);

$this->set('vv_primary_link_model', $linkTableName);

Expand Down
8 changes: 4 additions & 4 deletions app/src/Controller/MVEAController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
if(!empty($link->value)) {
$this->set('vv_primary_link_id', $link->value);

$Names = TableRegistry::get('Names');
$Names = $this->getTableLocator()->get('Names');

switch($link->attr) {
case 'external_identity_role_id':
$ExternalIdentityRoles = TableRegistry::get('ExternalIdentityRoles');
$ExternalIdentityRoles = $this->getTableLocator()->get('ExternalIdentityRoles');
$roleEntity = $ExternalIdentityRoles->findById((int)$link->value)->firstOrFail();

// Note this is a string, but vv_person_name is an entity
$this->set('vv_ei_role', $ExternalIdentityRoles->generateDisplayField($roleEntity));
$this->set('vv_ei_role_id', $link->value);
// fall through
case 'external_identity_id':
$ExternalIdentity = TableRegistry::get('ExternalIdentities');
$ExternalIdentity = $this->getTableLocator()->get('ExternalIdentities');

// What's the Person ID for the ExternalIdentity?
$eiId = isset($roleEntity) ? $roleEntity->external_identity_id : $link->value;
Expand All @@ -84,7 +84,7 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
$this->set('vv_person_id', $externalIdentity->person_id);
break;
case 'person_role_id':
$PersonRoles = TableRegistry::get('PersonRoles');
$PersonRoles = $this->getTableLocator()->get('PersonRoles');
$roleEntity = $PersonRoles->findById((int)$link->value)->firstOrFail();
// Note this is a string, but vv_person_name is an entity
$this->set('vv_person_role', $PersonRoles->generateDisplayField($roleEntity));
Expand Down
2 changes: 1 addition & 1 deletion app/src/Model/Table/ApiUsersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function validationDefault(Validator $validator): Validator {
$validator->add('co_id', [
'content' => ['rule' => 'isInteger']
]);
$validator->notEmpty('co_id');
$validator->notEmptyString('co_id');

$this->registerStringValidation($validator, $schema, 'username', true);

Expand Down