Skip to content

Commit 6a34c38

Browse files
committed
Use passed-in class name when clearing initializing list
1 parent 865cc19 commit 6a34c38

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Locator/TableLocator.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,8 @@ public function getConfig(?string $alias = null): array
208208
*/
209209
public function get(string $alias, array $options = []): Table
210210
{
211-
/** @var \Cake\ORM\Table $table */
212-
$table = parent::get($alias, $options);
213-
214-
$className = get_class($table);
215-
unset($this->initializing[$className]);
216-
217-
return $table;
211+
/** @var \Cake\ORM\Table */
212+
return parent::get($alias, $options);
218213
}
219214

220215
/**
@@ -283,6 +278,9 @@ protected function createInstance(string $alias, array $options)
283278
$this->_fallbacked[$alias] = $instance;
284279
}
285280

281+
// clear initializing flag after construction complete
282+
unset($this->initializing[$options['className']]);
283+
286284
return $instance;
287285
}
288286

0 commit comments

Comments
 (0)