File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,14 +10,10 @@ abstract class Selection implements \CoolBeans\Contract\Selection
1010
1111 protected const ROW_CLASS = \CoolBeans \Bean::class;
1212
13- protected \ReflectionClass $ reflection ;
14-
1513 final public function __construct (
1614 protected \Nette \Database \Table \Selection $ selection ,
1715 )
1816 {
19- $ this ->reflection = new \ReflectionClass (static ::class);
20-
2117 if (\CoolBeans \Config::$ validateTableName ) {
2218 $ this ->validateTableName ();
2319 }
@@ -221,8 +217,9 @@ final protected static function createRow(?\Nette\Database\Table\ActiveRow $row)
221217 */
222218 protected function validateTableName () : void
223219 {
220+ $ reflection = new \ReflectionClass (static ::class);
224221 $ tableName = $ this ->getTableName ();
225- $ className = \substr ($ this -> reflection ->getShortName (), 0 , -9 );
222+ $ className = \substr ($ reflection ->getShortName (), 0 , -9 );
226223 $ sepIndex = \Nette \Utils \Strings::indexOf ($ tableName , '. ' );
227224
228225 if (\is_int ($ sepIndex )) {
You can’t perform that action at this time.
0 commit comments