use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
use Org\Mxchange\CoreFramework\Generic\FrameworkException;
+use Org\Mxchange\CoreFramework\Handler\Stream\IoHandler;
// Import SPL stuff
use \SplFileInfo;
*/
private $indexKey = '__idx';
+ /**
+ * The file I/O instance for the template loader
+ */
+ private $fileIoInstance = NULL;
+
/**
* The protected constructor. Do never instance from outside! You need to
* set a local file path. The class will then validate it.
public final function getIndexKey () {
return $this->indexKey;
}
+ /**
+ * Private getter for file IO instance
+ *
+ * @return $fileIoInstance An instance to the file I/O sub-system
+ */
+ protected final function getFileIoInstance () {
+ return $this->fileIoInstance;
+ }
+
+ /**
+ * Setter for file I/O instance
+ *
+ * @param $fileIoInstance An instance to the file I/O sub-system
+ * @return void
+ */
+ public final function setFileIoInstance (IoHandler $fileIoInstance) {
+ $this->fileIoInstance = $fileIoInstance;
+ }
/**
* Reads a local data file and returns it's contents in an array
* @param $rowName Name of the row
* @return $infoInstance An instance of a SplFileInfo class
*/
- private function generateFileFromDataSet (Criteria $dataSetInstance, $rowName) {
+ private function generateFileFromDataSet (Criteria $dataSetInstance, string $rowName) {
// Instanciate new file object
$infoInstance = new SplFileInfo($this->getConfigInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . DIRECTORY_SEPARATOR . $rowName . '.' . $this->getFileExtension());
* @throws UnsupportedCriteriaException If the criteria is unsupported
* @throws SqlException If an 'SQL error' occurs
*/
- public function querySelect ($tableName, LocalSearchCriteria $searchInstance) {
+ public function querySelect (string $tableName, LocalSearchCriteria $searchInstance) {
// The result is null by any errors
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CACHED-LFDB: tableName=%s,searchInstance=%s - CALLED!', $tableName, $searchInstance->__toString()));
$resultData = NULL;
* @return $primaryKey Primary key column of the given table
* @todo Rename method to getPrimaryKeyFromTableInfo()
*/
- public function getPrimaryKeyOfTable ($tableName) {
+ public function getPrimaryKeyOfTable (string $tableName) {
// Default key is null
$primaryKey = NULL;
* @param $tableName Table name
* @return $count Total rows of given table
*/
- public function countTotalRows($tableName) {
+ public function countTotalRows (string $tableName) {
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CACHED-LFDB: tableName=' . $tableName . ' - CALLED!');
// Create full path name