Interface luya\console\interfaces\ImportControllerInterface

Implemented byluya\console\commands\ImportController
Available since version1.0.0
Source Code https://github.com/luyadev/luya/blob/master/core/console/interfaces/ImportControllerInterface.php

Command ImportController Interface.

Public Methods

Hide inherited methods

Method Description Defined By
addLog() Add something to the log output. luya\console\interfaces\ImportControllerInterface
getDirectoryFiles() Get all files from a directory. luya\console\interfaces\ImportControllerInterface

Method Details

Hide inherited methods

addLog() public abstract method

Add something to the log output.

$this->addLog(get_called_class(), 'new block <ID> have been found and added to database');
public abstract void addLog ( $section, $value )
$section string

The section of where the log is executed.

$value string

The message to log.

                public function addLog($section, $value);

            
getDirectoryFiles() public abstract method

Get all files from a directory.

The directory must be in _scanFolders map of the {{luya\console\commands\ImporterController}}. An array will be returned with the keys:

  • file: The name of the file inside the provided folder (e.g. MyBlock.php)
  • module: The name of the module where the file belongs to.
  • ns: The namespace for the file including the filename itself.

Usage example:

$this->getDirectoryFiles('blocks');

If there are no files found getDirectoryFiles will return an empty array.

public abstract array getDirectoryFiles ( $folderName )
$folderName string

The folder name to find all files from.

return array

If no files found for the given folder an empty array will be returned, otherwise a list of all files inside the given folder.

                public function getDirectoryFiles($folderName);