src/Controller/Component/UserToolComponent.php
public function setUserTable($table = null) {
		if ($table === null) {
			$this->UserTable = $this->getController()->{$this->getController()->modelClass};
		} else {
			if (is_object($table)) {
				if (!is_a($table, Table::class)) {
					throw new RuntimeException('Passed object is not of type \Cake\ORM\Table!');
				}
				$this->UserTable = $table->getAlias();
			}
			if (is_string($table)) {
				$this->UserTable = TableRegistry::get($table);
			}
		}

		$this->getController()->set('userTable', $this->UserTable->getAlias());
	}
public function setUserTable($table = null) {
		if ($table === null) {
			$this->UserTable = $this->getController()->{$this->getController()->modelClass};
		} else {
			if (is_object($table)) {
				if (!is_a($table, Table::class)) {
					throw new RuntimeException('Passed object is not of type \Cake\ORM\Table!');
				}
				$this->UserTable = $table->getAlias();
			}
			if (is_string($table)) {
				$this->UserTable = TableRegistry::get($table);
			}
		}

		$this->getController()->set('userTable', $this->UserTable->getAlias());
	}
public function setUserTable ( $ table = null ) { if ( $ table === null ) { $ this -> UserTable = $ this -> getController ( ) -> { $ this -> getController ( ) -> modelClass } ; } else { if ( is_object ( $ table ) ) { if ( ! is_a ( $ table , Table :: class ) ) { throw new RuntimeException ( 'Passed object is not of type \Cake\ORM\Table!' ) ; } $ this -> UserTable = $ table -> getAlias ( ) ; } if ( is_string ( $ table ) ) { $ this -> UserTable = TableRegistry :: get ( $ table ) ; } } $ this -> getController ( ) -> set ( 'userTable' , $ this -> UserTable -> getAlias ( ) ) ; }
Sets or instantiates the user model class.

@param null|string|\Cake\ORM\Table $table Table name or a table object
@throws \RuntimeException
@return void
Sets or instantiates the user model class .