diff --git a/app/src/Controller/ApiV2Controller.php b/app/src/Controller/ApiV2Controller.php index 79c79bd0c..38206d077 100644 --- a/app/src/Controller/ApiV2Controller.php +++ b/app/src/Controller/ApiV2Controller.php @@ -55,7 +55,7 @@ public function initialize(): void { // requested model = models $reqModel = $this->request->getParam('model'); - // $this->name = Models + /** var string $modelsName */ // We override $this->name (which is ApiV2) to make it match to the expected // behavior for UI calls (which is Models, eg "Cous"). We need to do this // before RegistryAuthComponent runs. @@ -76,10 +76,10 @@ public function initialize(): void { */ public function add() { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $this->tableName; @@ -180,10 +180,10 @@ public function calculateRequestedCOID(): ?int { */ public function delete($id) { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); @@ -232,9 +232,9 @@ protected function dispatchIndex(string $mode = 'default') { } // $modelsName = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); $reqParameters = [...$this->request->getQuery()]; $pickerMode = ($mode === 'picker'); @@ -265,10 +265,10 @@ protected function dispatchIndex(string $mode = 'default') { */ public function edit($id) { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); @@ -387,10 +387,10 @@ public function index() { */ public function view($id = null) { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index 3bbcee3d7..b5e923597 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -48,7 +48,6 @@ * @property \Cake\Controller\Component\FlashComponent $Flash * @property \Cake\Controller\Component\FormProtectionComponent $FormProtection */ -#[\AllowDynamicProperties] class AppController extends Controller { use \App\Lib\Traits\LabeledLogTrait; @@ -221,8 +220,8 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { */ public function beforeRender(\Cake\Event\EventInterface $event) { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // Views can also inspect the request object to determine the current // controller and action, but it seems slightly easier to do it once here. @@ -278,8 +277,8 @@ public function getCOID(): ?int { protected function primaryLinkOnGet(string $potentialPrimaryLink): Object|bool { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // If this action allows unkeyed, asserted primary link IDs, check the query // string (e.g.: 'add' or 'index' allow matchgrid_id to be passed in) @@ -312,8 +311,8 @@ protected function primaryLinkOnGet(string $potentialPrimaryLink): Object|bool protected function primaryLinkOnPost(string $potentialPrimaryLink): Object|bool { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // Post = add, where we can have a list of objects and nothing in /objects/{id} // We don't support different primary links across objects, so we throw an error @@ -345,8 +344,8 @@ protected function primaryLinkOnPost(string $potentialPrimaryLink): Object|bool protected function primaryLinkOnPut(): Object|bool { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); $param = (int)$this->request->getParam('pass.0'); // Put = edit, so we should look up the parent ID via the object itself @@ -368,8 +367,8 @@ protected function primaryLinkOnPut(): Object|bool */ protected function populatedPrimaryLink(string $potentialPrimaryLink): Object { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // $potentialPrimaryLink will be something like 'attribute_collector_id' // $potentialPrimaryLinkTable will be something like 'CoreEnroller.AttributeCollectors' $potentialPrimaryLinkTable = $this->$modelsName->getPrimaryLinkTableName($potentialPrimaryLink); @@ -406,8 +405,8 @@ protected function populatedPrimaryLink(string $potentialPrimaryLink): Object protected function primaryLinkLookup(): void { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); $availablePrimaryLinks = $this->$modelsName->getPrimaryLinks(); // Iterate over all the potential primary links and pick the appropriate one @@ -478,8 +477,8 @@ public function getPrimaryLink(bool $lookup=false): Object return $this->cur_pl; } - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); $this->cur_pl = new \stdClass(); @@ -540,8 +539,8 @@ public function getPrimaryLink(bool $lookup=false): Object */ protected function getRedirectGoal(string $action): ?string { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // PrimaryLinkTrait if(method_exists($this->$modelsName, "getRedirectGoal")) { @@ -663,8 +662,8 @@ protected function setCO() { } if(!$coid) { - // $this->name = Models, unless we're in an API call - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); $attrs = $this->request->getAttributes(); @@ -773,8 +772,8 @@ protected function setCO() { */ protected function setTZ() { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // See if we've collected it from the browser in a previous page load. Otherwise, // use the system default. If the user set a preferred timezone, we'll catch that below. diff --git a/app/src/Controller/Component/RegistryAuthComponent.php b/app/src/Controller/Component/RegistryAuthComponent.php index c0492dc9a..e4d114aad 100644 --- a/app/src/Controller/Component/RegistryAuthComponent.php +++ b/app/src/Controller/Component/RegistryAuthComponent.php @@ -347,9 +347,9 @@ protected function calculatePermissions(?int $id=null): array { // This will need to be prefixed to the model, if set $pluginName = $controller->getPlugin(); - // $this->name = Models (ie: from ModelsTable) + /** var string $modelsName */ $modelsName = ($pluginName ? "$pluginName." : "") . $controller->getName(); - // $table = the actual table object + /** var Cake\ORM\Table $table */ $table = $controller->getTableLocator()->get($modelsName); // Do we have an authenticated user? diff --git a/app/src/Controller/MVEAController.php b/app/src/Controller/MVEAController.php index 55bac618c..0af6cc082 100644 --- a/app/src/Controller/MVEAController.php +++ b/app/src/Controller/MVEAController.php @@ -45,8 +45,8 @@ class MVEAController extends StandardController { */ public function beforeFilter(\Cake\Event\EventInterface $event) { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); if(!$this->request->is('restful') && $this->request->getParam('action') != 'deleted') { // Provide additional hints to BreadcrumbsComponent. This needs to be here @@ -138,8 +138,8 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { */ public function beforeRender(\Cake\Event\EventInterface $event) { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); // field = model (or model_name) $fieldName = Inflector::underscore(Inflector::singularize($modelsName)); diff --git a/app/src/Controller/MultipleAuthenticatorController.php b/app/src/Controller/MultipleAuthenticatorController.php index 5db40f43b..5c9e32933 100644 --- a/app/src/Controller/MultipleAuthenticatorController.php +++ b/app/src/Controller/MultipleAuthenticatorController.php @@ -48,10 +48,10 @@ class MultipleAuthenticatorController extends StandardPluginController { public function beforeFilter(\Cake\Event\EventInterface $event) { // $modelsName = Models (eg: SshKeys) - $modelsName = $this->name; + $modelsName = $this->getName(); // $authModelName = eg SshKeyAuthenticators $authModelsName = Inflector::singularize($modelsName) . "Authenticators"; - // $table = the actual table object + /** var Cake\ORM\Table $table */ $Table = $this->$modelsName; // $authFK = eg ssh_key_authenticator_id $authFK = StringUtilities::classNameToForeignKey($authModelsName); @@ -98,10 +98,10 @@ public function beforeRender(\Cake\Event\EventInterface $event) { public function generateRedirect($entity) { // $modelsName = Models (eg: SshKeys) - $modelsName = $this->name; + $modelsName = $this->getName(); // $authModelName = eg SshKeyAuthenticators $authModelsName = Inflector::singularize($modelsName) . "Authenticators"; - // $table = the actual table object + /** var Cake\ORM\Table $table */ $Table = $this->$modelsName; // $authFK = eg ssh_key_authenticator_id $authFK = StringUtilities::classNameToForeignKey($authModelsName); @@ -132,10 +132,10 @@ public function generateRedirect($entity) { */ public function index() { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); // Construct the Query @@ -181,10 +181,10 @@ public function index() { public function willHandleAuth(\Cake\Event\EventInterface $event): string { // $modelsName = Models (eg: SshKeys) - $modelsName = $this->name; + $modelsName = $this->getName(); // $authModelName = eg SshKeyAuthenticators $authModelsName = Inflector::singularize($modelsName) . "Authenticators"; - // $table = the actual table object + /** var Cake\ORM\Table $table */ $Table = $this->$modelsName; // $authFK = eg ssh_key_authenticator_id $authFK = StringUtilities::classNameToForeignKey($authModelsName); diff --git a/app/src/Controller/SingleAuthenticatorController.php b/app/src/Controller/SingleAuthenticatorController.php index 0c06b48b3..b2c9dd3f5 100644 --- a/app/src/Controller/SingleAuthenticatorController.php +++ b/app/src/Controller/SingleAuthenticatorController.php @@ -43,10 +43,10 @@ class SingleAuthenticatorController extends StandardPluginController { public function manage() { // $modelsName = Models (eg: Passwords) - $modelsName = $this->name; + $modelsName = $this->getName(); // $authModelName = eg PasswordAuthenticators $authModelsName = Inflector::singularize($modelsName) . "Authenticators"; - // $table = the actual table object + /** var Cake\ORM\Table $table */ $Table = $this->$modelsName; // $authFK = eg password_authenticator_id $authFK = StringUtilities::classNameToForeignKey($authModelsName); diff --git a/app/src/Controller/StandardController.php b/app/src/Controller/StandardController.php index c65d6e369..db341aff1 100644 --- a/app/src/Controller/StandardController.php +++ b/app/src/Controller/StandardController.php @@ -52,10 +52,10 @@ class StandardController extends AppController { */ public function add() { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); // Schema @@ -171,10 +171,10 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { // XXX can we merge calls ot (eg) getPrimaryLink and populateAutoViewVars here? public function beforeRender(\Cake\Event\EventInterface $event) { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Provide some hints to the views if($this->request->getParam('action') != 'deleted') { @@ -236,10 +236,10 @@ public function beforeRender(\Cake\Event\EventInterface $event) { */ public function delete($id) { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Allow a delete via a POST or DELETE $this->request->allowMethod(['post', 'delete']); @@ -346,7 +346,7 @@ public function delete($id) { public function deleted() { // Set the title when not set at the individual controller if(empty($this->viewBuilder()->getVar('vv_title'))) { - $modelsName = $this->name; + $modelsName = $this->getName(); $fieldName = Inflector::singularize($modelsName); if(__d('result', $fieldName . '.deleted') != $fieldName . '.deleted') { // Use the standard (singular) deleted message for the field when it exists @@ -373,10 +373,10 @@ public function deleted() { */ public function edit(string $id) { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); @@ -586,10 +586,10 @@ public function generateRedirect($entity) { */ protected function getFieldTypes() { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); $schema = $table->getSchema(); @@ -609,10 +609,10 @@ protected function getFieldTypes() { */ protected function getRequiredFields() { - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Build a list of required fields for FieldHelper $reqFields = []; @@ -636,10 +636,10 @@ protected function getRequiredFields() { */ public function index() { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); // Construct the Query @@ -688,10 +688,10 @@ public function index() { */ protected function populateAutoViewVars(object $obj=null) { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // AutoViewVarsTrait if(method_exists($table, 'getAutoViewVars') && $table->getAutoViewVars()) { @@ -709,10 +709,10 @@ protected function populateAutoViewVars(object $obj=null) { */ public function provision($id) { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); @@ -754,10 +754,10 @@ public function provision($id) { */ public function unfreeze($id) { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); try { // Pull the current record @@ -785,10 +785,10 @@ public function unfreeze($id) { */ public function view($id = null) { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // $tableName = models $tableName = $table->getTable(); diff --git a/app/src/Controller/StandardEnrollerController.php b/app/src/Controller/StandardEnrollerController.php index e61423499..697a6db33 100644 --- a/app/src/Controller/StandardEnrollerController.php +++ b/app/src/Controller/StandardEnrollerController.php @@ -96,7 +96,7 @@ public function calculatePermission(): bool { // We need the Step configuration to properly calculate the current Actor // for Approval Steps. - $modelsName = $this->name; + $modelsName = $this->getName(); $modelId = $this->request->getParam('pass.0'); if(!$modelId) { @@ -220,8 +220,8 @@ public function willHandleAuth(\Cake\Event\EventInterface $event): string { // Determine if we're going to use a token to authenticate the current request. // For this, we need the current step's authorization. - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); $modelId = $this->request->getParam('pass.0'); if(empty($modelId)) { diff --git a/app/src/Controller/StandardPluggableController.php b/app/src/Controller/StandardPluggableController.php index e8f33c287..5fdea66e8 100644 --- a/app/src/Controller/StandardPluggableController.php +++ b/app/src/Controller/StandardPluggableController.php @@ -46,10 +46,10 @@ public function configure(string $id) { // (We only need to map into the plugin on actual link click, instead of // potentially many times on an index view for links that may not be used.) - // $this->name = Models (ie: from ModelsTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); $parentId = $this->request->getParam('pass')[0]; $parentObj = $table->findById($parentId) diff --git a/app/src/Controller/StandardPluginController.php b/app/src/Controller/StandardPluginController.php index 02e1c653e..54940b816 100644 --- a/app/src/Controller/StandardPluginController.php +++ b/app/src/Controller/StandardPluginController.php @@ -46,8 +46,8 @@ class StandardPluginController extends StandardController { */ public function beforeFilter(\Cake\Event\EventInterface $event) { - // $this->name = Models - $modelsName = $this->name; + /** var string $modelsName */ + $modelsName = $this->getName(); if(!$this->request->is('restful')) { // Provide additional hints to BreadcrumbsComponent. This needs to be here @@ -82,10 +82,10 @@ public function beforeFilter(\Cake\Event\EventInterface $event) { */ public function beforeRender(\Cake\Event\EventInterface $event) { - // $this->name = Models (ie: from ModelsTable, eg FileProvisionersTable) - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ (ie: from ModelsTable, eg FileProvisionersTable) + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); $link = $this->getPrimaryLink(true); diff --git a/app/src/Lib/Traits/AutoViewVarsTrait.php b/app/src/Lib/Traits/AutoViewVarsTrait.php index 9dcc59431..5893f5a8f 100644 --- a/app/src/Lib/Traits/AutoViewVarsTrait.php +++ b/app/src/Lib/Traits/AutoViewVarsTrait.php @@ -71,7 +71,7 @@ public function setAutoViewVars($vars): void { */ public function calculateAutoViewVars(int|null $coId, Object $obj = null): \Generator { - // $table = the actual table object + /** var Cake\ORM\Table $table */ $table = $this; foreach($table->getAutoViewVars() as $vvar => $avv) { diff --git a/app/src/Lib/Traits/IndexQueryTrait.php b/app/src/Lib/Traits/IndexQueryTrait.php index 0a3e9fb76..6e6ebb145 100644 --- a/app/src/Lib/Traits/IndexQueryTrait.php +++ b/app/src/Lib/Traits/IndexQueryTrait.php @@ -44,10 +44,10 @@ trait IndexQueryTrait { * @since COmanage Registry v5.0.0 */ public function constructGetIndexContains(Query $query): object { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Initialize the containClause $containClause = []; @@ -73,10 +73,10 @@ public function constructGetIndexContains(Query $query): object { * @since COmanage Registry v5.0.0 */ public function constructGetPickerContains(Query $query): object { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Initialize the containClause $containClause = []; @@ -104,10 +104,10 @@ public function constructGetPickerContains(Query $query): object { */ public function containClauseFromQueryParams(): array { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // Restfull and ajax do not include the IndexContains by default. $containClause = []; @@ -153,10 +153,10 @@ public function containClauseFromQueryParams(): array * @since COmanage Registry v5.0.0 */ public function getIndexQuery(bool $pickerMode = false, array $requestParams = []): object { - // $this->name = Models - $modelsName = $this->name; - // $table = the actual table object - $table = $this->$modelsName; + /** var string $modelsName */ + $modelsName = $this->getName(); + /** var Cake\ORM\Table $table */ + $table = $this->fetchTable($modelsName); // PrimaryLinkTrait $link = $this->getPrimaryLink(true); // Initialize the Query Object diff --git a/app/templates/EnrollmentFlows/start.inc b/app/templates/EnrollmentFlows/start.inc index 446ef0a98..b4941bc5a 100644 --- a/app/templates/EnrollmentFlows/start.inc +++ b/app/templates/EnrollmentFlows/start.inc @@ -27,8 +27,8 @@ declare(strict_types = 1); -// $this->name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); // $tablename = models $tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name)); // Table Reference diff --git a/app/templates/ExternalIdentitySources/search.php b/app/templates/ExternalIdentitySources/search.php index 61f5d2e01..094ae6b0a 100644 --- a/app/templates/ExternalIdentitySources/search.php +++ b/app/templates/ExternalIdentitySources/search.php @@ -28,7 +28,7 @@ declare(strict_types = 1); // Required by the subnavigation partial -$modelsName = $this->name; +$modelsName = $this->getName(); // Subnavigation calculations if(file_exists(ROOT . DS . 'templates' . DS . 'Standard/subnavigation.inc')) { include(ROOT . DS . 'templates' . DS . 'Standard/subnavigation.inc'); diff --git a/app/templates/Standard/add-edit-view.php b/app/templates/Standard/add-edit-view.php index 7e157cf9b..24ad18887 100644 --- a/app/templates/Standard/add-edit-view.php +++ b/app/templates/Standard/add-edit-view.php @@ -28,8 +28,8 @@ declare(strict_types = 1); //$action = $this->template; -// $this->name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); // $tablename = models // XXX backport to match? $tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name)); diff --git a/app/templates/Standard/deleted.php b/app/templates/Standard/deleted.php index 4086ed885..0a0edf5ce 100644 --- a/app/templates/Standard/deleted.php +++ b/app/templates/Standard/deleted.php @@ -28,7 +28,7 @@ declare(strict_types = 1); -$modelsName = $this->name; +$modelsName = $this->getName(); $tableName = \Cake\Utility\Inflector::tableize(\Cake\Utility\Inflector::singularize($this->name)); // $vv_template_path will be set for plugins diff --git a/app/templates/Standard/dispatch.php b/app/templates/Standard/dispatch.php index 294c453a9..84d2e3352 100644 --- a/app/templates/Standard/dispatch.php +++ b/app/templates/Standard/dispatch.php @@ -27,10 +27,10 @@ declare(strict_types = 1); -// $this->name = Models +/** var string $modelsName */ use Cake\Utility\Inflector; -$modelsName = $this->name; +$modelsName = $this->getName(); // $tablename = models $tableName = Inflector::tableize(Inflector::singularize($this->name)); // Populate the AutoViewVars. These are the same we do for the EnrollmentAttributes configuration view diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 2f474c32c..581ad77ef 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -35,8 +35,8 @@ //use \App\Lib\Enum\StatusEnum; use \Cake\Utility\Inflector; -// $this->name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); // $tablename = models // XXX backport to match? $tableName = Inflector::tableize(Inflector::singularize($this->name)); diff --git a/app/templates/element/bulk/bulk.php b/app/templates/element/bulk/bulk.php index 08633b227..e5d42491f 100644 --- a/app/templates/element/bulk/bulk.php +++ b/app/templates/element/bulk/bulk.php @@ -43,8 +43,8 @@ use App\Lib\Enum\BulkActionEnum; use \Cake\Utility\Inflector; -// $this->name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); // $tablename = models // XXX backport to match? $tableName = Inflector::tableize($this->name); diff --git a/app/templates/element/filter/dateSingle.php b/app/templates/element/filter/dateSingle.php index 1230fad0b..9c920a817 100644 --- a/app/templates/element/filter/dateSingle.php +++ b/app/templates/element/filter/dateSingle.php @@ -43,7 +43,7 @@ // $columns = the passed parameter $indexColumns as found in columns.inc; // provides overrides for labels and sorting. $columns = $vv_indexColumns; -$modelsName = $this->name; +$modelsName = $this->getName(); $label = Inflector::humanize( Inflector::underscore( diff --git a/app/templates/element/filter/default.php b/app/templates/element/filter/default.php index ca1b4ced7..14e62759d 100644 --- a/app/templates/element/filter/default.php +++ b/app/templates/element/filter/default.php @@ -40,7 +40,7 @@ // $columns = the passed parameter $indexColumns as found in columns.inc; provides overrides for labels and sorting. $columns = $vv_indexColumns; -$modelsName = $this->name; +$modelsName = $this->getName(); $label = Inflector::humanize( Inflector::underscore( diff --git a/app/templates/element/filter/filter.php b/app/templates/element/filter/filter.php index bd8a1b99e..3635aeaf1 100644 --- a/app/templates/element/filter/filter.php +++ b/app/templates/element/filter/filter.php @@ -49,8 +49,8 @@ name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); // $modelName = Model $modelName = Inflector::singularize($modelsName); diff --git a/app/templates/element/filter/options.php b/app/templates/element/filter/options.php index 876613f56..771327e85 100644 --- a/app/templates/element/filter/options.php +++ b/app/templates/element/filter/options.php @@ -29,7 +29,7 @@ use App\Lib\Enum\ApplicationStateEnum; -$modelsName = $this->name; +$modelsName = $this->getName(); ?> diff --git a/app/templates/element/filter/peoplePicker.php b/app/templates/element/filter/peoplePicker.php index d6164cad0..4d24dd9f1 100644 --- a/app/templates/element/filter/peoplePicker.php +++ b/app/templates/element/filter/peoplePicker.php @@ -40,7 +40,7 @@ // $columns = the passed parameter $indexColumns as found in columns.inc; provides overrides for labels and sorting. $columns = $vv_indexColumns; -$modelsName = $this->name; +$modelsName = $this->getName(); $label = Inflector::humanize( Inflector::underscore( diff --git a/app/templates/element/subnavigation/navBar.php b/app/templates/element/subnavigation/navBar.php index 6f4268e58..fe5a27886 100644 --- a/app/templates/element/subnavigation/navBar.php +++ b/app/templates/element/subnavigation/navBar.php @@ -41,8 +41,8 @@ $this->set('vv_sub_nav_attributes', $subNavAttributes); extract($subNavAttributes, EXTR_PREFIX_ALL, 'vv_subnavigation'); -// $this->name = Models -$modelsName = $this->name; +/** var string $modelsName */ +$modelsName = $this->getName(); $fullModelsName = !empty($this->getPlugin()) ? $this->getPlugin() . '.' . $modelsName : $modelsName; ?>